Former two-weight UFC champion Conor McGregor has announced on Twitter that he is retiring from the sport for the third time.