diff --git a/SKPhotoBrowser.podspec b/SKPhotoBrowser.podspec index 939dec17..472ae86d 100644 --- a/SKPhotoBrowser.podspec +++ b/SKPhotoBrowser.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "SKPhotoBrowser" - s.version = "1.7.9" + s.version = "1.8.0" 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/SKZoomingScrollView.swift b/SKPhotoBrowser/SKZoomingScrollView.swift index 5aaab723..883479b9 100644 --- a/SKPhotoBrowser/SKZoomingScrollView.swift +++ b/SKPhotoBrowser/SKZoomingScrollView.swift @@ -120,12 +120,14 @@ public class SKZoomingScrollView: UIScrollView, UIScrollViewDelegate, SKDetectin var maxScale: CGFloat! let deviceScreenWidth = UIScreen.mainScreen().bounds.width + let deviceScreenHeight = UIScreen.mainScreen().bounds.height if photoImageView.frame.width < deviceScreenWidth { - if deviceScreenWidth / 2 > photoImageView.frame.width { - maxScale = 3.0 + // I think that we should to get coefficient between device screen width and image width and assign it to maxScale. I made two mode that we will get the same result for different device orientations. + if UIApplication.sharedApplication().statusBarOrientation.isPortrait { + maxScale = deviceScreenHeight / photoImageView.frame.width } else { - maxScale = 2.0 + maxScale = deviceScreenWidth / photoImageView.frame.width } } else if photoImageView.frame.width > deviceScreenWidth { maxScale = 1.0