Merge pull request #79 from alexsanderkhitev/master

the second try to fix the #68 bug
This commit is contained in:
Alexsander Khitev 2016-04-04 12:45:43 +04:00
commit e5b2be2b44
2 changed files with 6 additions and 4 deletions

View File

@ -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" }

View File

@ -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