Skip to content

Instantly share code, notes, and snippets.

@amleszk
Created March 23, 2013 01:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amleszk/5225924 to your computer and use it in GitHub Desktop.
Save amleszk/5225924 to your computer and use it in GitHub Desktop.
Hack to get around Facebook keyboard hiding, to keep compatibility for another hack to UIWindowLevel described here:(http://stackoverflow.com/questions/3753097/how-to-detect-touches-in-status-bar)
-(void) presentShareController:(SLComposeViewController*)shareCompose
{
if ([shareCompose.serviceType isEqualToString:SLServiceTypeFacebook]) {
UIWindow *window = [[UIApplication sharedApplication] keyWindow];
UIWindowLevel prevWindowLevel = window.windowLevel;
window.windowLevel = UIWindowLevelNormal;
SLComposeViewControllerCompletionHandler handler = shareCompose.completionHandler;
shareCompose.completionHandler = ^(SLComposeViewControllerResult result){
window.windowLevel = prevWindowLevel;
if (handler) {
handler(result);
}
};
}
[self presentViewController:shareCompose
animated:YES
completion:nil];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment