Skip to content
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

Configurable ImageView #56

Closed
ivanbruel opened this issue Sep 19, 2016 · 4 comments
Closed

Configurable ImageView #56

ivanbruel opened this issue Sep 19, 2016 · 4 comments

Comments

@ivanbruel
Copy link

I've been using Kingfisher as my image loading dependency alongside its AnimatedImageView which adds support for GIF loading.

As such, in order to take advantage of this in ImageViewer I had to make the imageView property public in the ImageViewerController class.

As this might be a problem for other people using different dependencies, might be nice to get this change into the library.

I've forked the project and made the change myself, let me know if it makes sense to open a pull request.

Example usage:

let buttonAssets = CloseButtonAssets(normal: closeIcon,
                                         highlighted: closeIcon)
let configuration = ImageViewerConfiguration(imageSize: CGSize(width: 10, height: 10),
                                                 closeButtonAssets: buttonAssets)
let imageViewer = ImageViewerController(imageProvider: viewModel, configuration: configuration,
                                            displacedView: view.imageView)
let imageView = AnimatedImageView()
imageView.framePreloadCount = 1
imageViewer.imageView = imageView
presentImageViewer(imageViewer)
@twalenciak
Copy link

+1 I've got similar issue with animated ImageView subclass, using FLAnimatedImage, and also resolved this by fork and made this property public.

I think possibility of providing custom imageView could be very convenient for many users.

@zfoltin
Copy link
Collaborator

zfoltin commented Nov 12, 2016

Hey @ivanbruel & @twalenciak

ImageViewer changed a lot in v3.0. Now there is only the GalleryViewController where you provide GalleryItems through a DataSource. A GalleryItem is either an image or a video at the moment.

I'm thinking if you create an extension on AnimatedImageView and FLAnimatedImage to conform to our ItemView protocol and return these views from your data source delegate then it should just work. The only requirement is to define an image: UIImage? property on the types. Does that make sense?

Would this solve the issue? Have you updated to v3.1 or v4.0 yet?

@zfoltin
Copy link
Collaborator

zfoltin commented Nov 12, 2016

Ok, looking at the issue a bit closer, I've implemented a way to add custom ViewControllers to the gallery - this view controller can then work with a custom view
See the commit zfoltin@9eb10c1
Particularly the bottom of Example/ViewController.swift shows how to integrate something like AnimatedImageView or FLAnimatedImageView

Any feedback welcome! :)

@zfoltin
Copy link
Collaborator

zfoltin commented Nov 16, 2016

Hopefully #80 helps if you need a custom GalleryItem. Closing for now but hoping to get some feedback @ivanbruel and @twalenciak if you find the time :)

@zfoltin zfoltin closed this as completed Nov 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants