From 02409ae3982c6be23766c6badd901f9ece0cf762 Mon Sep 17 00:00:00 2001 From: Alexsandersky Date: Mon, 7 Mar 2016 01:25:30 +0400 Subject: [PATCH] added autoresize to closeButton and marked where we should to fix --- SKPhotoBrowser/SKPhotoBrowser.swift | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/SKPhotoBrowser/SKPhotoBrowser.swift b/SKPhotoBrowser/SKPhotoBrowser.swift index d1a10ec..dd2cbe1 100644 --- a/SKPhotoBrowser/SKPhotoBrowser.swift +++ b/SKPhotoBrowser/SKPhotoBrowser.swift @@ -321,6 +321,8 @@ public class SKPhotoBrowser: UIViewController, UIScrollViewDelegate { closeButtonHideFrame = CGRect(x: 5, y: -20, width: 44, height: 44) closeButtonShowFrame = CGRect(x: 5, y: 5, width: 44, height: 44) view.addSubview(closeButton) + closeButton.translatesAutoresizingMaskIntoConstraints = true + closeButton.autoresizingMask = [.FlexibleBottomMargin, .FlexibleLeftMargin, .FlexibleRightMargin, .FlexibleTopMargin] } } @@ -1073,8 +1075,12 @@ public class SKPhotoBrowser: UIViewController, UIScrollViewDelegate { // MARK: - device rotation @objc private func changeOrientation() { // setControlsHidden(true, animated: false, permanent: false) - // 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) + // FIXME: - when we will to resolve this probleb 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) + + // customCloseButtonShowFrame = customCloseButtonShowOldFrame + // customCloseButtonHideFrame = customCloseButtonHideOldFrame // if displayCustomCloseButton == true { // if customCloseButtonShowFrame != nil && customCloseButtonHideFrame != nil { // if customCloseButtonConstraints == nil {