Permalink
Browse files

Merge pull request #173 from a2/master

Fix __IPHONE_OS_VERSION_{MIN_REQUIRED,MAX_ALLOWED} mixup in SSWebViewController
  • Loading branch information...
2 parents 4c32fb7 + 89354d1 commit 87d3f4d8c6f0d1ccfdf86902898c3c76b00aaef7 @calebd calebd committed Mar 25, 2013
Showing with 6 additions and 7 deletions.
  1. +6 −7 SSToolkit/SSWebViewController.m
@@ -144,14 +144,13 @@ - (NSURL *)currentURL {
#pragma mark - Actions
- (void)close:(id)sender {
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_5_0
@calebd

calebd Mar 25, 2013

Contributor

Hmm so now this compiles both, and since the return is gone, it tries presenting / dismissing twice which results in this runtime message:

Warning: Attempt to dismiss from view controller <SEERootViewController: 0xb884970> while a presentation or dismiss is in progress!
@calebd

calebd Mar 25, 2013

Contributor

Fixed in 7109505.

+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_5_0
if ([self.navigationController respondsToSelector:@selector(dismissViewControllerAnimated:completion:)])
{
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
- return;
}
#endif
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_6_0
+#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0
[self.navigationController dismissModalViewControllerAnimated:YES];
#endif
}
@@ -191,14 +190,14 @@ - (void)emailURL:(id)sender {
viewController.mailComposeDelegate = self;
[viewController setMessageBody:_webView.lastRequest.mainDocumentURL.absoluteString isHTML:NO];
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_5_0
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_5_0
if ([self.navigationController respondsToSelector:@selector(presentViewController:animated:completion:)])
{
[self.navigationController presentViewController:viewController animated:YES completion:nil];
return;
}
#endif
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_6_0
+#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0
[self.navigationController presentModalViewController:viewController animated:YES];
#endif
}
@@ -274,14 +273,14 @@ - (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSIn
#pragma mark - MFMailComposeViewControllerDelegate
- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error {
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_5_0
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_5_0
if ([controller respondsToSelector:@selector(dismissViewControllerAnimated:completion:)])
{
[controller dismissViewControllerAnimated:YES completion:nil];
return;
}
#endif
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_6_0
+#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0
[controller dismissModalViewControllerAnimated:YES];
#endif
}

0 comments on commit 87d3f4d

Please sign in to comment.