diff --git a/Source/TBActionSheet/UIWindow+TBAdditions.h b/Source/TBActionSheet/UIWindow+TBAdditions.h index 5ac29c7..dbb2801 100644 --- a/Source/TBActionSheet/UIWindow+TBAdditions.h +++ b/Source/TBActionSheet/UIWindow+TBAdditions.h @@ -12,6 +12,5 @@ - (UIViewController *)tb_viewControllerForStatusBarStyle; - (UIViewController *)tb_viewControllerForStatusBarHidden; -- (UIImage *)tb_snapshot; - (UIViewController *)currentViewController; @end diff --git a/Source/TBActionSheet/UIWindow+TBAdditions.m b/Source/TBActionSheet/UIWindow+TBAdditions.m index 110d552..f91e348 100644 --- a/Source/TBActionSheet/UIWindow+TBAdditions.m +++ b/Source/TBActionSheet/UIWindow+TBAdditions.m @@ -31,56 +31,6 @@ - (UIViewController *)tb_viewControllerForStatusBarHidden return currentViewController; } -- (UIImage *)tb_snapshot -{ - // source (under MIT license): https://github.com/shinydevelopment/SDScreenshotCapture/blob/master/SDScreenshotCapture/SDScreenshotCapture.m#L35 - - // UIWindow doesn't have to be rotated on iOS 8+. - BOOL ignoreOrientation = kiOS8Later; - - UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; - - CGSize imageSize = CGSizeZero; - if (UIInterfaceOrientationIsPortrait(orientation) || ignoreOrientation) { - imageSize = [UIScreen mainScreen].bounds.size; - } else { - imageSize = CGSizeMake([UIScreen mainScreen].bounds.size.height, [UIScreen mainScreen].bounds.size.width); - } - - UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0); - CGContextRef context = UIGraphicsGetCurrentContext(); - CGContextSaveGState(context); - CGContextTranslateCTM(context, self.center.x, self.center.y); - CGContextConcatCTM(context, self.transform); - CGContextTranslateCTM(context, -self.bounds.size.width * self.layer.anchorPoint.x, -self.bounds.size.height * self.layer.anchorPoint.y); - - // correct for the screen orientation - if (!ignoreOrientation) { - if (orientation == UIInterfaceOrientationLandscapeLeft) { - CGContextRotateCTM(context, (CGFloat)M_PI_2); - CGContextTranslateCTM(context, 0, -imageSize.width); - } else if (orientation == UIInterfaceOrientationLandscapeRight) { - CGContextRotateCTM(context, (CGFloat)-M_PI_2); - CGContextTranslateCTM(context, -imageSize.height, 0); - } else if (orientation == UIInterfaceOrientationPortraitUpsideDown) { - CGContextRotateCTM(context, (CGFloat)M_PI); - CGContextTranslateCTM(context, -imageSize.width, -imageSize.height); - } - } - - if([self respondsToSelector:@selector(drawViewHierarchyInRect:afterScreenUpdates:)]) { - [self drawViewHierarchyInRect:self.bounds afterScreenUpdates:NO]; - } else {/* iOS 6 */ - [self.layer renderInContext:UIGraphicsGetCurrentContext()]; - } - - CGContextRestoreGState(context); - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - - return image; -} - - (UIViewController *)currentViewController { UIViewController *viewController = self.rootViewController; diff --git a/TBActionSheet.podspec b/TBActionSheet.podspec index 41d817e..79d622c 100644 --- a/TBActionSheet.podspec +++ b/TBActionSheet.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "TBActionSheet" -s.version = "1.7.0" +s.version = "1.7.1" s.summary = "A Custom&Magical ActionSheet." s.description = <<-DESC TBActionSheet is a small library that allows you to substitute Apple's uncustomizable UIActionSheet, with a beautiful and totally customizable actionsheet that you can use in your iOS app. The default style is iOS9/10, you can make your own style. Enjoy! @@ -17,7 +17,7 @@ s.platform = :ios, '7.0' s.requires_arc = true s.source_files = "Source/**/*.{h,m}" -s.public_header_files = "Source/TBActionSheet/TBActionButton.h", "Source/TBActionSheet/TBActionSheet.h", "Source/TBAlertController/TBAlertController.h" +s.public_header_files = "Source/TBActionSheet/TBActionButton.h", "Source/TBActionSheet/TBActionSheet.h", "Source/TBActionSheet/UIView+TBAdditions.h", "Source/TBActionSheet/UIWindow+TBAdditions.h", "Source/TBAlertController/TBAlertController.h" s.frameworks = 'Foundation', 'UIKit' end