krisiacik / imageviewer Goto Github PK
View Code? Open in Web Editor NEWAn image viewer à la Twitter
License: MIT License
An image viewer à la Twitter
License: MIT License
How about adding property to tune black background alpha or even add blur to underneath view?
Like in JTSImageViewController:
Thanks for awesome library!
Hello,
By refer to your code, I wonder how I can pass my selected Image to display?
class PoorManProvider: ImageProvider {
func provideImage(completion: UIImage? -> Void) {
completion(UIImage(named: "image_big"))
}
}
I think a presentingViewController?.dismissViewControllerAnimated statement is missing at line 457 of ImageViewer.swift
Could be?
Anyway, great work!
Suggested by @chuckurbis
This can be set in the utility function that is making the screenshot. Helps to make screenshots that are non-rectangle shaped.
Thanks for your work =) 👍🏻
I'm facing a problem with the image viewer using the following configuration:
let configuration: GalleryConfiguration = [
/// presentation style
GalleryConfigurationItem.presentationStyle(.displacement),
GalleryConfigurationItem.statusBarHidden(true),
/// top buttons
GalleryConfigurationItem.thumbnailsButtonMode(.none),
GalleryConfigurationItem.closeLayout(.pinRight(30, 30)),
GalleryConfigurationItem.closeButtonMode(.custom(closeButton)),
/// displacement technique
//GalleryConfigurationItem.displacementKeepOriginalInPlace(false),
GalleryConfigurationItem.displacementInsetMargin(20),
GalleryConfigurationItem.displacementDuration(0.5),
GalleryConfigurationItem.displacementTimingCurve(.easeInOut),
GalleryConfigurationItem.reverseDisplacementDuration(0.5),
/// disable fade and blur
GalleryConfigurationItem.overlayBlurOpacity(0),
GalleryConfigurationItem.itemFadeDuration(0),
]
When I press the close button, I want my image to be displaced into its original position of the parent view. However, this is not happening. The image viewer simply closes and shows the parent view abruptly without any kind of animation.
I have disabled fade and blur on purpose to show only the image displacement when closing the viewer.
Am I missing something here?
Now that we have codebase to support multiple images that required to create slightly different API, there is a question of what to do with legacy API.
Shall we
At the moment the main background colour is hardcoded to black.
Hello,
I've been having trouble figuring out how to setup the asynchronous loading of images in galleryviewcontroller. Could you provide a snippet that will give me a hint on how to do this?
Hi,
It's will be great to create a Swift 3 version of your component
Article about Swift 3:
With Swift 3 it would also be nice to add support for SwiftPM
Articles about SwiftPM:
On your README.md
add on top and add section for the installation with SwiftPM.
button.setImage(UIImage(named: "close_normal"), forState: UIControlState.Normal)
button.setImage(UIImage(named: "close_highlighted"), forState: UIControlState.Highlighted)
Podspec doesn't add any assets. When I manually copied them from demo project it worked.
Idea - maybe draw it programmatically instead of using images?
Hi, I'm wondering if there is a way to reverse the initial animation that opens up the viewer. I have an image that grows nicely onto the screen, and I'd like the dismiss animation to reverse that and shrink the image down to its original location. Is this possible?
Please add Activity view controller support via delegate method so that the sharing and all those default features can be used over the image
It seems it's not possible to install the version 3 via cocoapods?
The .podspec of v3 points to v2.0.
I also used this line:
pod 'ImageViewer', :git => '[email protected]:MailOnline/ImageViewer.git', :tag => '3.0'
or
pod 'ImageViewer', :git => '[email protected]:MailOnline/ImageViewer.git', :commit => 'f887383cc4fc32374f4096329253b2df5a79c11a'
but it produces strange error:
GalleryViewController.swift:367:36: Use of unresolved identifier 'ThumbnailsViewController'
.
Any ideas?
Hello, when passing a UIImageView
(which has a contentMode
of .ScaleAspectFit
) as a displaced view, GalleryViewController
maintains the image size. If the image is fit by height it maintains the aspect ratio and does not layout to the new bounds.
passing first image as displaced:
switching to next image:
passing second image as displaced:
switching to first image:
I need an extra view to add Comments, share, delete button at the bottom of gallery view.. is it possible to add
Why 2-part version numbers are used? Why not classic semantic versioning?
If there is no apparent reason to keep it - I suggest using full MAJOR.MINOR.PATCH
in future releases:
MAJOR
- breaking API change
MINOR
- new features added
PATCH
- bugfixes without breaking any public API
In some cases with some devices (i.e: iPhone 7plus simulator and image 7/7 of the example), the return from AVMakeRectWithAspectRatioInsideRect
in aspectFitContentSize:
has some decimals that makes this comparison to be false, provoking a bug when zooming in.
Using floor()
for this comparison makes the trick. I already created the fix on my fork. Let me know if you agree and want me to create a PR to master.
Thanks for a super framework - I am stuck on how to add a button as the footer to allow me to fetch a hi-res version of the photo on the screen. I have followed the example of CounterView and I can make the button appear as a Decoaration (footerView) but it is not clickable. Could you pls post a snippet or explanation of how to do this - thanks
It'd be great to add a config option to disable the single tap behavior of hiding and showing the header and footer view.
Close button is not showing
Absolutely love ImageViewer!
I have put a gesture recogniser on the footerView to "Fetch a High Res Copy and Save to Camera Roll"....works fine..
..how can I force the page/gallery to reload the image so that it will pick up the larger version of the image for display?
Is there any way to disable scroll horizontal to dismiss preview mode ?
Thanks :)
I add pod "ImageViewer" to pod file, make pod install and it installs. After that how to use ImageViewer class if there is no module to import and it does not see ImageViewer class?
Hey, I see some config items for spinner customization, but don't actually see it in my application. More than that - I can't find any code related to UIActivity
or spinner config items.
ImageViewer is going to evolve to a full fledged Gallery.
Requirements:
Visual transition from article to gallery should match the experience provided by ImageViewer so far i.e. using the displacement effect.
The gallery will have these view elements
image counter (positioned in the top middle)
close button (top right)
caption (on top of social share sheet)
social share sheet (bottom)
horizontally paging images (in the middle)
root
-> common views
-> paging (scrollview with images...or similar)
It seems as if the version that is coming from cocoapods is an old version of ImageViewer.
With xcode 8, i'm forced to Swift 2.3 and the new version of ImageViewer can handle this.
My workaround is using this in my PodFile
pod 'ImageViewer', :git => 'https://github.com/MailOnline/ImageViewer.git'
but then this has an issue with missing file ThumbnailsViewController.swift and ThumbnailCell.swift
I always see
VideoScrubber deinit 💣
on ImageViewer dismissing. Even when there are no videos in gallery. This is too verbose/unneeded log for me and most of users.
I see verbose log of version changes and no instructions for quick start.
I propose moving changelog to CHANGELOG.md
and adding quick start section with minimal instructions and delegate example for mix of local and remote images.
ImageViewer is awesome. I use ImageViewer in an app that is not going to be released any time soon. ImageViewer was easy to integrate with. Love your project.
Xcode8.0 beta was released yesterday and I have started migrating my own projects to swift3.
Any plans for this?
compatibility with swift 3
For galeries with dozens of images a grid like special view with thumbnails would keep UX fine.
One thing would have to be ensured. Some kind of mutually exclusive layout logic between the close button and thumbnails button.
Hey guys!
I've been using your lib a lot and I ran into a small issue (for my purposes).
I want to display the gallery from a not-fullscreen modal view controller. However, when I tried to do this, the blur view only covered that same view controller and left the rest of the screen visible.
I found out that it was happening because the blur view is being added to the parent view controller, so it keeps the size of the parent.
To fix this I added the blur view to the back of the gallery instead, this way occupying the whole screen.
Is this the "correct" behaviour for the gallery and should I open a Pull Request or the current behaviour is best?
Cheers! 🍻
Hello, any idea to customise the transition style when presenting the image?
For some reason when I try to dismiss an image by swiping down dragging the image down, the image becomes "stuck" to the bottom. Dismissing the image by swiping up works perfectly, as well as through close button. Looked at the code, and both directions should work just fine with the pangesture. Could you help me out?
The project where I'm working now already has an GalleryViewController
type 😁
So I forced to use the correct GalleryViewController
type calling it explicitly with the module name ImageViewer
like
let imageGallery = ImageViewer.GalleryViewController(imageProvider: imageProvider, displacedView: collectionView.cellForItemAtIndexPath(indexPath), imageCount: collectionDataSource.data.count, startIndex: index)
but then the compiler generates this error:
"Type 'ImageViewer' has no member GalleryViewController
".
Any workaround? (maybe using a class prefix?)
If an ImageViewer
is created but never presented, its various view properties, namely scrollView
, will never be initialized, and so will crash the app in deinit
when scrollView.removeObserver(self, forKeyPath: "contentOffset")
is called. Simply changing the deinit
to scrollView?.removeObserver(self, forKeyPath: "contentOffset")
fixes the issue.
Hello!
Faced a feature today, but no idea how to make it real.. In standard Apple "Photos".app we can swipe like carusel(thnx for this!) and sometimes can swipe it till video-files... How did they managed to do this and how to implement it in this library? Also will be a great enhancement to library as well in general...
How is it possible to remove an image from the gallery using a "Delete Button" e.g. in the footer view similar to a "Close Button"?
Do u guys know that there is no CounterView class in imageView framework. However there is line using this class in Readme.md
Hey, first of all, great library and also being developed rapidly.
Here is a little question. I am using displacement views and if I close the gallery by tapping on close button - the gallery is closed correctly and the image is animated back to displaced view.
BUT if I close the gallery with swipe gesture - it is simply going out of the screen without returning to displaced view.
Any fix for this? Or ImageViewer does not have this feature yet?
Hello,
Is possible to play youtube video in the gallery?
Thanks in advance
Hi, when the images are provided by a multiple image picker such as BSImagePicker ([https://github.com/mikaoj/BSImagePicker]) , the first image does not load until the first page is reloaded via scrolling a few images over then back. Any idea as to a fix? I feel like it has to do with the initial animation for the displaced view, which I have tried to disable, but still didn't fix the issue. Thanks for your time!
Seems to launchedCompletion
block is never executed.
cocoapods support would be sweet :)
Can you guys please update
The swift version right now is 2.3. Stay tuned for 3.0.
I think it is already swift 3?
Hello!
I am trying to show a very big (panorama) image in carusel and every time I swiping to this image it loads too long... The main thread is blocking by it, wondering about using this pod with ASDK from Facebook, but may be any other solutions?
If I want to modyfy the UIImageView of this where should I "dig"?
Tnx anyway
Solved by using ASImageNode from ASDK(google it) replacing UIImageView
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)
The Documentation is Nowhere to be found. I dont want to show a gallery of images, just a single image.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.