Skip to content

Commit

Permalink
Merge pull request #46 from alexsanderskywork/master
Browse files Browse the repository at this point in the history
Some changes.
  • Loading branch information
alexanderkhitev committed Mar 11, 2016
2 parents 4395a26 + 5628222 commit 1a159e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 47 deletions.
2 changes: 1 addition & 1 deletion SKPhotoBrowser.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SKPhotoBrowser"
s.version = "1.6.7"
s.version = "1.6.8"
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" }
Expand Down
48 changes: 2 additions & 46 deletions SKPhotoBrowser/SKPhotoBrowser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,15 @@ public class SKPhotoBrowser: UIViewController, UIScrollViewDelegate {

//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 {
/*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)
}
}
}*/

pagingScrollView.contentOffset = contentOffsetForPageAtIndex(currentPageIndex)
// where did start
Expand Down Expand Up @@ -1185,50 +1185,6 @@ public class SKPhotoBrowser: UIViewController, UIScrollViewDelegate {
// FIXME: - when we will to resolve this problem https://github.com/suzuki-0000/SKPhotoBrowser/issues/22 it will need to remove
deleteButtonShowFrame = CGRect(x: view.frame.width - 44, y: 5, width: 44, height: 44)
deleteButtonHideFrame = CGRect(x: view.frame.width - 44, y: -20, width: 44, height: 44)
// I didn't add customDeleteButton frame here



// customCloseButtonShowFrame = customCloseButtonShowOldFrame
// customCloseButtonHideFrame = customCloseButtonHideOldFrame
// if displayCustomCloseButton == true {
// if customCloseButtonShowFrame != nil && customCloseButtonHideFrame != nil {
// if customCloseButtonConstraints == nil {
// switch startOrientation {
// case 1, 2:
// changeCustomPortraitFrameAfterRotation()
// case 3, 4:
// changeCustomLandscapeFrameAfterRotation()
// default: break
// }
// }
// }
// }
// setControlsHidden(false, animated: false, permanent: false)
}

// FIXME: - Maybe it will be needed in the future
private func changeCustomPortraitFrameAfterRotation() {
if UIApplication.sharedApplication().statusBarOrientation.isLandscape {
customCloseButtonShowFrame = CGRect(x: customCloseButtonShowOldFrame.origin.x * 2, y: customCloseButtonShowOldFrame.origin.y / 2 + customCloseButtonShowOldFrame.height / 4, width: customCloseButtonShowOldFrame.width, height: customCloseButtonShowOldFrame.height)
customCloseButtonHideFrame = CGRect(x: customCloseButtonHideOldFrame.origin.x * 2, y: customCloseButtonHideOldFrame.origin.y / 2, width: customCloseButtonHideOldFrame.width, height: customCloseButtonHideOldFrame.height)
} else {
customCloseButtonShowFrame = CGRect(x: customCloseButtonShowOldFrame.origin.x, y: customCloseButtonShowOldFrame.origin.y, width: customCloseButtonShowOldFrame.width, height: customCloseButtonShowOldFrame.height)

customCloseButtonHideFrame = CGRect(x: customCloseButtonHideOldFrame.origin.x, y: customCloseButtonHideOldFrame.origin.y, width: customCloseButtonHideOldFrame.width, height: customCloseButtonHideOldFrame.height)
}
}

private func changeCustomLandscapeFrameAfterRotation() {
if UIApplication.sharedApplication().statusBarOrientation.isPortrait {
customCloseButtonShowFrame = CGRect(x: customCloseButtonShowOldFrame.origin.x / 2, y: customCloseButtonShowOldFrame.origin.y * 2 - customCloseButtonShowOldFrame.height / 2, width: customCloseButtonShowOldFrame.width, height: customCloseButtonShowOldFrame.height)

customCloseButtonHideFrame = CGRect(x: customCloseButtonHideOldFrame.origin.x / 2, y: customCloseButtonHideOldFrame.origin.y * 2 - customCloseButtonShowOldFrame.height / 2, width: customCloseButtonHideOldFrame.width, height: customCloseButtonHideOldFrame.height)
} else {
customCloseButtonShowFrame = CGRect(x: customCloseButtonShowOldFrame.origin.x, y: customCloseButtonShowOldFrame.origin.y, width: customCloseButtonShowOldFrame.width, height: customCloseButtonShowOldFrame.height)

customCloseButtonHideFrame = CGRect(x: customCloseButtonHideOldFrame.origin.x, y: customCloseButtonHideOldFrame.origin.y, width: customCloseButtonHideOldFrame.width, height: customCloseButtonHideOldFrame.height)
}
}
}

Expand Down

0 comments on commit 1a159e5

Please sign in to comment.