Skip to content
This repository has been archived by the owner on Feb 16, 2019. It is now read-only.

Commit

Permalink
Merge pull request #171 from a2/master
Browse files Browse the repository at this point in the history
Fix iOS 6 deprecation warnings
  • Loading branch information
soffes committed Mar 19, 2013
2 parents 6bd46fc + 14795ef commit 4d4ccad
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SSToolkit/SSTextView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
28 changes: 28 additions & 0 deletions SSToolkit/SSWebViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
}


Expand Down Expand Up @@ -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
}


Expand Down Expand Up @@ -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

0 comments on commit 4d4ccad

Please sign in to comment.