diff --git a/SKPhotoBrowser.podspec b/SKPhotoBrowser.podspec index b13694c..0cc9617 100644 --- a/SKPhotoBrowser.podspec +++ b/SKPhotoBrowser.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "SKPhotoBrowser" - s.version = "2.0.2" + s.version = "2.0.4" s.summary = "Simple PhotoBrowser/Viewer inspired by facebook, twitter photo browsers written by swift2.0." s.homepage = "https://github.com/suzuki-0000/SKPhotoBrowser" s.license = { :type => "MIT", :file => "LICENSE" } diff --git a/SKPhotoBrowser.xcodeproj/project.pbxproj b/SKPhotoBrowser.xcodeproj/project.pbxproj index 5131020..6aa8d46 100644 --- a/SKPhotoBrowser.xcodeproj/project.pbxproj +++ b/SKPhotoBrowser.xcodeproj/project.pbxproj @@ -220,6 +220,7 @@ TargetAttributes = { 8909B52F1BC791280060A053 = { CreatedOnToolsVersion = 7.0; + LastSwiftMigration = 0800; }; A64B89321CB04222000071B9 = { CreatedOnToolsVersion = 7.3; @@ -430,6 +431,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 2.3; }; name = Debug; }; @@ -448,6 +450,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.keishi.suzuki.SKPhotoBrowser; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; + SWIFT_VERSION = 2.3; }; name = Release; }; diff --git a/SKPhotoBrowser/SKPhotoBrowser.swift b/SKPhotoBrowser/SKPhotoBrowser.swift index fc2d310..ffd5a7f 100644 --- a/SKPhotoBrowser/SKPhotoBrowser.swift +++ b/SKPhotoBrowser/SKPhotoBrowser.swift @@ -202,7 +202,7 @@ public class SKPhotoBrowser: UIViewController { public func dismissPhotoBrowser(animated animated: Bool, completion: (Void -> Void)? = nil) { prepareForClosePhotoBrowser() - + if !animated { modalTransitionStyle = .CrossDissolve } @@ -633,4 +633,4 @@ extension SKPhotoBrowser: UIScrollViewDelegate { public func scrollViewDidEndScrollingAnimation(scrollView: UIScrollView) { isEndAnimationByToolBar = true } -} \ No newline at end of file +} diff --git a/SKPhotoBrowser/extensions/UIImage+Rotation.swift b/SKPhotoBrowser/extensions/UIImage+Rotation.swift index 09ed323..be342a6 100644 --- a/SKPhotoBrowser/extensions/UIImage+Rotation.swift +++ b/SKPhotoBrowser/extensions/UIImage+Rotation.swift @@ -52,21 +52,21 @@ extension UIImage { // Now we draw the underlying CGImage into a new context, applying the transform // calculated above. let ctx = CGBitmapContextCreate(nil, Int(self.size.width), Int(self.size.height), - CGImageGetBitsPerComponent(self.CGImage), 0, - CGImageGetColorSpace(self.CGImage), - CGImageGetBitmapInfo(self.CGImage).rawValue) - CGContextConcatCTM(ctx, transform) + CGImageGetBitsPerComponent(self.CGImage!), 0, + CGImageGetColorSpace(self.CGImage!)!, + CGImageGetBitmapInfo(self.CGImage!).rawValue) + CGContextConcatCTM(ctx!, transform) switch self.imageOrientation { case .Left, .LeftMirrored, .Right, .RightMirrored: - CGContextDrawImage(ctx, CGRect(x: 0, y: 0, width: size.height, height: size.width), self.CGImage) + CGContextDrawImage(ctx!, CGRect(x: 0, y: 0, width: size.height, height: size.width), self.CGImage!) default: - CGContextDrawImage(ctx, CGRect(x: 0, y: 0, width: size.width, height: size.height), self.CGImage) + CGContextDrawImage(ctx!, CGRect(x: 0, y: 0, width: size.width, height: size.height), self.CGImage!) } // And now we just create a new UIImage from the drawing context - if let cgImage = CGBitmapContextCreateImage(ctx) { + if let cgImage = CGBitmapContextCreateImage(ctx!) { return UIImage(CGImage: cgImage) } else { return self