If you look at the documentation, you will also see a mention of an alternative api. The FBSDKLoginManager documentation says:
- (void)logInWithReadPermissions:(NSArray *)permissions handler:(FBSDKLoginManagerRequestTokenHandler)handler __attribute__((deprecated("use logInWithReadPermissions: fromViewController:handler: instead")));
So, there is a new method that also takes an optional UIViewController parameter to determine where the logical sequence started from. As the documentation says:
- (void)logInWithReadPermissions:(NSArray *)permissions fromViewController:(UIViewController *)fromViewController handler:(FBSDKLoginManagerRequestTokenHandler)handler;
and an explanation of the parameters says:
fromViewController - the view controller for the view. If nil, the topmost controller will be automatically detected as well as possible.
Since there is only one additional parameter, you can add it to an existing implementation as follows:
FBSDKLoginManager().logInWithReadPermissions(["public_profile", "others"], fromViewController:self
The latest xcode should also offer you, when you write, logInWithReadPermissions with all the options available.
source share