lctwisk / simpleimageviewer Goto Github PK
View Code? Open in Web Editor NEWA snappy image viewer with zoom and interactive dismissal transition.
License: MIT License
A snappy image viewer with zoom and interactive dismissal transition.
License: MIT License
I just installed simpleViewer as a pod. And I have confirmed that there is no closeButton image file. So I added a closebutoon file to my asset. I still get that message. Why?
Thank you for your great open source.
After showing the image I'm trying to change the background colour of the image view with transparent?
I tried to change the background colour on imageViewerController.xib and sets the imageViewerController.swift programatically. But I didn't get any changes in that behaviour still it appears black color background
Can you please help me on that?
Thanks in advance
When I am transitioning to the original view controller, I am having the squared image in transition.
Can I customize any pod setting to have it in a circle while transitioning.
Some forced unwraps can cause crashes depending on what's being done in the host application.
Package Resolution Failed
SimpleImageViewer.git could not be resolved
because every version of SimpleImageViewer contains incompatible tools version and root depends on SimpleImageViewer 1.1.2..<2.0.0, version solving failed.
completion for dismissing view controller
no completion for dismissing view controller
It's a good library to have for previewing image. I was wondering if there is any way to add custom buttons inside the preview like share or delete the image.
No animation no swipe to dismiss when presenting from table view ...
IPhone 8 goes down a few pixels down.
Other devices have no problem.
It seems to be a problem of iPhone X's height, but I do not know the solution.
When integrating this Pod into a Xcode project in swift 4.2, it should compile.
It does not compile.
Integrate this Pod into an Xcode project where the main target's swift_version is set to 4.2.
I just noticed, this pod doesn't take into account the UIKit renamings that occurred in swift 4.2.
Can you provide an example to load the full image size in a block ?
ie :
let configuration = ImageViewerConfiguration { config in
config.imageView = self.thumbnailImageView
config.imageBlock = {
// What to put here ?
}
}
Thank you!
I'd like the ability to get a callback, either through a closure or a delegate method when the user requests to close the view controller. This better matches Apple's own API's (e.g. UIImagePickerControllerDelegate
) and allows the code that presented SimpleImageViewer
to also be in charge of dismissing it.
Currently, there is no way to control this. SimpleImageViewer
dismisses itself when the X button is tapped by the user.
I wanted to know as the library maintainer whether you would like a feature like this added to the library or whether you would be OK with making small changes to SimpleImageViewer
to make it subclassable.
Right now, I've modified it to make it subclassable to add this feature. I really want to submit a pull request for either solution you prefer (hopefully you like one of them ๐). But I wanted to get the opinion of someone that maintains the project before blindly submitting a PR ๐.
And a big thanks for the library. Small UI's like this are so helpful to iOS development where even such a "simple" task as showing an image full screen can take so long when doing them from scratch.
How hard would it be to replace the imageview with another custom view?
With the proper updated description for Cocoapod and others
I use the following code in my project,
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let message = dataArray.object(at: indexPath.row) as! Message
if message.ID == "904" {
let cell = tableView.cellForRow(at: indexPath) as! ImageATableViewCell
let configuration = ImageViewerConfiguration { config in
config.imageView = cell.contentImage
}
present(ImageViewerController(configuration: configuration), animated: true)
} else {
let cell = tableView.cellForRow(at: indexPath) as! ImageBTableViewCell
let configuration = ImageViewerConfiguration { config in
config.imageView = cell.contentImage
}
present(ImageViewerController(configuration: configuration), animated: true)
}
}
When i click the row, it will work after around 1~10 second,
The weird thing is when i one more tap the screen, function can immediately work,
I also use the same image source test on UICollectionViewController, it's perfect work.
How can i fix that? thanks a lot :)
Will there be support to allow users to delete the image also?
No crash
Crash
Crashed: com.apple.main-thread
EXC_BREAKPOINT 0x0000000105759d5c
closure #1 in ImageViewerDismissalTransition.apply(state:)
Crashed: com.apple.main-thread 0 SimpleImageViewer 0x105759d5c closure #1 in ImageViewerDismissalTransition.apply(state:) + 115 (ImageViewerDismissalTransition.swift:115) 1 SimpleImageViewer 0x10575a018 thunk for @escaping @callee_guaranteed () -> () + 4318699544 (<compiler-generated>:4318699544) 2 UIKitCore 0x190b7f9cc +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 576 3 UIKitCore 0x190b7ffbc +[UIView(UIViewAnimationWithBlocks) animateWithDuration:delay:options:animations:completion:] + 112 4 SimpleImageViewer 0x105759038 ImageViewerDismissalInteractor.finish() + 4318695480 (ImageViewerDismissalInteractor.swift:4318695480) 5 SimpleImageViewer 0x1057587e8 ImageViewerController.imageViewPanned(_:) + 127 (ImageViewerController.swift:127) 6 SimpleImageViewer 0x105758afc @objc ImageViewerController.imageViewPanned(_:) + 4318694140 (<compiler-generated>:4318694140) 7 UIKitCore 0x1902ac968 -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] + 52 8 UIKitCore 0x1902b4fc8 _UIGestureRecognizerSendTargetActions + 128 9 UIKitCore 0x1902b274c _UIGestureRecognizerSendActions + 284 10 UIKitCore 0x1902b1c80 -[UIGestureRecognizer _updateGestureForActiveEvents] + 616 11 UIKitCore 0x1902a5c84 _UIGestureEnvironmentUpdate + 2040 12 UIKitCore 0x1902a5440 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 380 13 UIKitCore 0x1902a51f4 -[UIGestureEnvironment _updateForEvent:window:] + 220 14 UIKitCore 0x190716c6c -[UIWindow sendEvent:] + 3308 15 UIKitCore 0x1906f26b0 -[UIApplication sendEvent:] + 340 16 UIKitCore 0x19076cd04 __dispatchPreprocessedEventFromEventQueue + 5712 17 UIKitCore 0x19076f2bc __handleEventQueueInternal + 4928 18 UIKitCore 0x190768440 __handleHIDEventFetcherDrain + 112 19 CoreFoundation 0x18c56f24c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 20 CoreFoundation 0x18c56f1a0 __CFRunLoopDoSource0 + 84 21 CoreFoundation 0x18c56e90c __CFRunLoopDoSources0 + 184 22 CoreFoundation 0x18c5697d8 __CFRunLoopRun + 1068 23 CoreFoundation 0x18c569084 CFRunLoopRunSpecific + 480 24 GraphicsServices 0x1967b7534 GSEventRunModal + 108 25 UIKitCore 0x1906d9670 UIApplicationMain + 1940 26 Flyp 0x104b64530 main + 13 (main.swift:13) 27 libdyld.dylib 0x18c3e8e18 start + 4
Should have a linear animation when opening on iPhone X.
After the end of the animation the image has a jerky effect
Open any image with iPhone X
SimpleImageViewer
SimpleImageViewer
I do not think this is a performance issue. This can be improved by changing the implementation.
When dragging an image from detail view the image can rotate (like in the Tweetbot iOS application)
When swiping the image out of the screen, the user returns to the previous screen (image overview)
When letting the image go, it restores to the image detail screen, with the correct orientation and the image centred in the screen.
Image in detail view can be dragged but will stay oriented in the same orientation
Check example in Tweetbot iOS application
when i click on an image at a particular index in collection view that moment i want to download a high resolution image and pass that image in the imageviewer.
unitl the image downloads the screen gets stuck and doesn't present the image controller
Please update for Swift 5.0 Support
I found out that transitionHandler in ImageViewController is keeping it from deallocating. I hope that you will investigate further.
How can I apply CGAffineTransform to imageView ImageViewerConfiguration ?
I try this
let configuration = ImageViewerConfiguration { config in
config.imageView = imageView // my UImageView
let angle: CGFloat = (270.0 * CGFloat.pi/180.0)
config.imageView?.transform = CGAffineTransform(rotationAngle: angle)
}
but no effect
pass an array of UIImageView to config to pass between each one with a left or right swipe
swipe to left or right dismiss ImageViewer
scroll to next image and open that image on screen
but when i swipe to next and click on image view pervious image opened with simple image viewer
please someone help me how to fix Image view in scrolling images
it allowed to change background colour based on app theme
it showing in only Black color
Add Colour type variable in configuration so user can change the colour based on his requirements
I'm pushing the 'SimpleImageViewer' using navigation controller.
Everything works fine except it shows the close button.
I think close button should be settable to nil.
Encountered an error communicating with IBAgent-iOS.
I don't want to enable zooming option in my app. Can I disable it?
The viewwillappear is not called from the previous view controller even after releasing the simpleimageviewer by dismissing it after viewing the image in the simpleimageviewer.
I try to reload the collection view when I return to the previous view controller after inserting an add-in to the SimpleImage Viewer (editing or deleting an image), but viewwillappear is not called.
Do you have any plan to support iPhone X notch ? Currently the image is displayed behind the notch
One or multiple ImageViews are contained in a StackView. When an image is tapped, the SimpleImageViewer should do its transition.
Opening and closing transitions as expected.
StackView, that contains the ImageView, needs to re-calculate its layout as the transitions source view is set to hidden (isHidden = true). StackViews remove hidden views from the visual representation.
Please see the sample project attached. (SHA1: 7842862143d7b9a5d0ba1f6b102dc034ad9b2e68)
StackViewExample.zip
let configuration = ImageViewerConfiguration { config in
config.imageView?.image = UIImage(named:"Point.png")
print( UIImage(named:"Point.png")) // <- here is not nil
}
present(ImageViewerController(configuration: configuration), animated: true)
I sent an image like that. However, when I go to viewdidload in ImageViewerController, nil appears.
imageView.image = configuration?.imageView?.image ?? configuration?.image
print(imageView.image) // --> nil
I am using swift4.0.
This video which is recorded on a device will show you the steps to reproduce the bug. The application I've used is your example project. The only change I made to the project is resizing the images to smaller resolution.
The image view should shown in the center of the screen with close button properly in the top left corner
The image view shows in the center of the screen and then snaps 10-20 points lower. Also the close button in the top left corner is in a weird place
Tap on the image view that has simple image viewer set up
This is a long shot, but just in case anyone encountered the same issue: on iOS 13, dismissing an image will spark a different behavior on the presenting VC than dismissing by dragging the image far away.
It is not clear what exactly is or is not being called on the presenting VC. If that can help, it is a VC that shows a chat conversation using MessageKit, and the issue is that the input bar is not animating back into the view after dismissing the SimpleImage VC by dragging it. The bar does appear however when we close the image viewer by tapping the close button.
This issue also does not affect the app on iOS 12, so we suspect it might be linked to some of the VC lifecycle calls that are not been called anymore on iOS 13. But we also believe it shouldn't affect SimpleImageViewer, since the .overFullScreen
modal presentation style is used, and this is not one of the iOS 13 affected styles.
If anyone has any idea on what we could try, we'd love to hear your ideas. Thanks!
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.