-
Notifications
You must be signed in to change notification settings - Fork 331
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 buttons #98
Comments
put a completion-handler on the delete button would be so great! I found a solution: let lightbox = LightboxController(images: lightboxImages, startIndex: idx)
lightbox.headerView.deleteButton.addTarget(self, action: #selector(yourSelectorHere), for: .touchUpInside)
context?.present(lightbox, animated: true, completion: nil)` |
My intention was to make the image preview a part of JSQMessagesViewController (which is used from several places). So, I went this way as one more possible option to set custom actions for buttons:
|
... and in case there are several images in the Lightbox, it is still possible to reach to the currently shown image and share it:
NOTE: at the moment the theLightbox.images[theLightbox.currentPage].image will be nil if the respective LightboxImage was inited via imageURL (i.e. the image was downloaded by Lightbox itself). But there's a PR, which is supposed to fix this: #122 |
I want to add new buttons and keep both the close and delete button. How can these be achieved? |
@heisen273 @sverin Hi, sorry for late response. The design of Lightbox is to have delete and close button at the header. But you can totally do your own customisation by subclassing |
I know how to subclass the HeaderView, but I can't figure out how to use it since the headerView is set as fileprivate(set) in the LightboxController. |
@sverin Hi, the proposed changes during swift 4 migration is to exposed them as |
Agree that this at least seems problematic because it looks like
so we should probably be able to hook into that, right? |
Is there any way to add custom button? Or, for example, re-program existing "delete" button?
The text was updated successfully, but these errors were encountered: