-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add optional property for defining a custom fullscreen close button. #394
base: master
Are you sure you want to change the base?
Conversation
@@ -71,8 +74,13 @@ open class FullScreenSlideshowViewController: UIViewController { | |||
|
|||
view.addSubview(slideshow) | |||
|
|||
// close button configuration | |||
closeButton.setImage(UIImage(named: "ic_cross_white", in: Bundle(for: type(of: self)), compatibleWith: nil), for: UIControlState()) | |||
if closeButtonCustom != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace by if let
avoiding the force unwrapping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the slow reply. Just to confirm, this should be:
if let custom_button = closeButtonCustom {
closeButton = custom_button
}
Or something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if let closeButtonCustom = closeButtonCustom {
closeButton = closeButtonCustom
}
This would be better to keep same names in if let and not have multiple different names
@@ -71,8 +74,13 @@ open class FullScreenSlideshowViewController: UIViewController { | |||
|
|||
view.addSubview(slideshow) | |||
|
|||
// close button configuration | |||
closeButton.setImage(UIImage(named: "ic_cross_white", in: Bundle(for: type(of: self)), compatibleWith: nil), for: UIControlState()) | |||
if closeButtonCustom != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if let closeButtonCustom = closeButtonCustom {
closeButton = closeButtonCustom
}
This would be better to keep same names in if let and not have multiple different names
This PR tries to build on #385 but rather than defining new presets allows for a consume of the
ImageSlideshow
package to define a customUIButton
to use for ending fullscreen mode.The button is assigned to the slideshow's
fullscreenCloseButton
property which is then assigned to the FullScreenSlideshowViewController'scloseButtonCustom
property. For example: