Skip to content

Commit

Permalink
Add closeButtonFrame property to Full Screen controller (fixes zvonic…
Browse files Browse the repository at this point in the history
  • Loading branch information
zvonicek authored and Dirko Swanepoel committed Oct 17, 2018
1 parent 97d076f commit b647cb9
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ open class FullScreenSlideshowViewController: UIViewController {
/// Close button
open var closeButton = UIButton()

/// Close button frame
open var closeButtonFrame: CGRect?

/// Closure called on page selection
open var pageSelected: ((_ page: Int) -> Void)?

Expand Down Expand Up @@ -114,9 +117,8 @@ open class FullScreenSlideshowViewController: UIViewController {
} else {
safeAreaInsets = UIEdgeInsets.zero
}

closeButton.frame = CGRect(x: max(10, safeAreaInsets.left), y: max(10, safeAreaInsets.top), width: 40, height: 40)
caption.frame = CGRect(x: closeButton.frame.origin.x + 50, y: max(10, safeAreaInsets.top), width: self.view.frame.width - (closeButton.frame.origin.x + 50 + max(10, safeAreaInsets.right)), height: 40)

closeButton.frame = closeButtonFrame ?? CGRect(x: max(10, safeAreaInsets.left), y: max(10, safeAreaInsets.top), width: 40, height: 40)
}

slideshow.frame = view.frame
Expand Down

0 comments on commit b647cb9

Please sign in to comment.