Merge pull request #49 from alexsanderskywork/master

this new algorithm resizes the current image size after device rotation
This commit is contained in:
Alexsandersky 2016-03-13 20:05:03 +04:00
commit 1d0356bdd5
3 changed files with 16 additions and 15 deletions

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SKPhotoBrowser"
s.version = "1.6.8"
s.version = "1.6.9"
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

@ -282,20 +282,20 @@ public class SKPhotoBrowser: UIViewController, UIScrollViewDelegate {
isPerformingLayout = true
pagingScrollView.frame = frameForPagingScrollView()
pagingScrollView.contentSize = contentSizeForPagingScrollView()
// resize frames of buttons after the device rotation
frameForButton()
//If we open the SKPhotoBrowser from CollectionView not the first image, we have one element in visiblepages and we should to take 0 element from visibleindex but that we should to use frame we should use currentPageIndex for frame's functions.
// TODO: - need to fix this bug
/*if visiblePages.count > 0 {
let currentIndex = visiblePages.count - 1
let page = visiblePages[currentIndex]
page.frame = frameForPageAtIndex(currentPageIndex)
page.setMaxMinZoomScalesForCurrentBounds()
if page.captionView != nil {
page.captionView.frame = frameForCaptionView(page.captionView, index: currentIndex)
// this algorithm resizes the current image after device rotation
if visiblePages.count > 0 {
for page in visiblePages {
let pageIndex = page.tag - pageIndexTagOffset
page.frame = frameForPageAtIndex(pageIndex)
page.setMaxMinZoomScalesForCurrentBounds()
if page.captionView != nil {
page.captionView.frame = frameForCaptionView(page.captionView, index: pageIndex)
}
}
}*/
}
pagingScrollView.contentOffset = contentOffsetForPageAtIndex(currentPageIndex)
// where did start
didStartViewingPageAtIndex(currentPageIndex)

View File

@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIStatusBarHidden</key>
<false/>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
@ -32,11 +30,14 @@
<array>
<string>armv7</string>
</array>
<key>UIStatusBarHidden</key>
<false/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>