Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix iOS 6 deprecation warnings #171

Merged
merged 1 commit into from

3 participants

@a2
a2 commented

No description provided.

@a2 a2 Fix iOS 6 deprecation warnings
Signed-off-by: Alexsander Akers <a2@pandamonia.us>
14795ef
@soffes soffes merged commit 4d4ccad into soffes:master
@soffes
Owner

Thanks!

@calebd

Neither of these blocks of code get compiled for me (Deployment target = 5.0, SDK = 6.1). Sure this is right?

I'm sorry. I'm going to go back through them and fix this. Thanks for noticing.

EDIT: I think I switched __IPHONE_OS_VERSION_MIN_REQUIRED and __IPHONE_OS_VERSION_MAX_ALLOWED.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 18, 2013
  1. @a2

    Fix iOS 6 deprecation warnings

    a2 authored
    Signed-off-by: Alexsander Akers <a2@pandamonia.us>
This page is out of date. Refresh to see the latest.
Showing with 32 additions and 0 deletions.
  1. +4 −0 SSToolkit/SSTextView.m
  2. +28 −0 SSToolkit/SSWebViewController.m
View
4 SSToolkit/SSTextView.m
@@ -95,7 +95,11 @@ - (void)drawRect:(CGRect)rect {
// Draw the text
[_placeholderTextColor set];
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0
+ [_placeholder drawInRect:rect withFont:self.font lineBreakMode:NSLineBreakByTruncatingTail alignment:self.textAlignment];
+#else
[_placeholder drawInRect:rect withFont:self.font lineBreakMode:UILineBreakModeTailTruncation alignment:self.textAlignment];
+#endif
}
}
View
28 SSToolkit/SSWebViewController.m
@@ -144,7 +144,16 @@ - (NSURL *)currentURL {
#pragma mark - Actions
- (void)close:(id)sender {
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __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
[self.navigationController dismissModalViewControllerAnimated:YES];
+#endif
}
@@ -181,7 +190,17 @@ - (void)emailURL:(id)sender {
viewController.subject = self.title;
viewController.mailComposeDelegate = self;
[viewController setMessageBody:_webView.lastRequest.mainDocumentURL.absoluteString isHTML:NO];
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __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
[self.navigationController presentModalViewController:viewController animated:YES];
+#endif
}
@@ -255,7 +274,16 @@ - (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 ([controller respondsToSelector:@selector(dismissViewControllerAnimated:completion:)])
+ {
+ [controller dismissViewControllerAnimated:YES completion:nil];
+ return;
+ }
+#endif
+#if __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_6_0
[controller dismissModalViewControllerAnimated:YES];
+#endif
}
@end
Something went wrong with that request. Please try again.