Git Product home page Git Product logo

simpleimageviewer's People

Contributors

anarchoschnitzel avatar itsnoteasybeinggreen avatar jsahoo avatar lctwisk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simpleimageviewer's Issues

How to change the presented image background colour to transparent with alpha 0.5?

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

iPhoneX8 goes down a few pixels down.

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.

Missing .swift_version parameter in podspec

Expected behavior

When integrating this Pod into a Xcode project in swift 4.2, it should compile.

Actual behavior

It does not compile.

Steps to reproduce the behavior

Integrate this Pod into an Xcode project where the main target's swift_version is set to 4.2.

Podspec should just include the .swift_version parameter in podspec.

I just noticed, this pod doesn't take into account the UIKit renamings that occurred in swift 4.2.

How to use config.imageBlock ?

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!

Opinion: Add Feature to Library or Allow Subclassing

Expected behavior

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.

Actual behavior

Currently, there is no way to control this. SimpleImageViewer dismisses itself when the X button is tapped by the user.

Discussion

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 ๐Ÿ˜€.

Thanks

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.

Working delay on tableview

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 :)

Image Deletion?

Will there be support to allow users to delete the image also?

Crash reported by Crashlytics

Expected behavior

No crash

Actual behavior

Crash

Steps to reproduce the behavior

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

graphic issue on iPhone X

Expected behavior

Should have a linear animation when opening on iPhone X.

Actual behavior

After the end of the animation the image has a jerky effect

Steps to reproduce the behavior

Open any image with iPhone X

Swipe away should be possible immediately

Expected behavior

  • Tap image and it opens up in SimpleImageViewer
  • Swipe away immediately to close again

Actual behavior

  • Tap image and it opens up in SimpleImageViewer
  • It does not react to swipe gestures right away. It takes more than 1s. Also X button to close takes some time to appear

I do not think this is a performance issue. This can be improved by changing the implementation.

Crash because unexpected nil

Expected behavior

When dismissing the view I expect to hide the view.

Actual behavior

The app crashed because an unexpected nil in this line:
screen_shot_2018-04-27_at_07 18 36

Steps to reproduce the behavior

Everytime I want to dismiss the image with a gesture or with the X.

I hope you can help me fix this.
Thanks

Swipe image out of screen to go back, where image orientation is dynamic

Expected behavior

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.

Actual behavior

Image in detail view can be dragged but will stay oriented in the same orientation

Steps to reproduce the behavior

Check example in Tweetbot iOS application

ImageBlock

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

imageView with CGAffineTransform

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

SimpleImageViewer with FSPagerView

Expected behavior

scroll to next image and open that image on screen

Actual behavior

but when i swipe to next and click on image view pervious image opened with simple image viewer

Steps to reproduce the behavior

please someone help me how to fix Image view in scrolling images

close button should be optional

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.

Viewwillappear is not called

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.

Jump in StackView

Setup

One or multiple ImageViews are contained in a StackView. When an image is tapped, the SimpleImageViewer should do its transition.

Expected behavior

Opening and closing transitions as expected.

Actual behavior

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.

Steps to reproduce the behavior

Please see the sample project attached. (SHA1: 7842862143d7b9a5d0ba1f6b102dc034ad9b2e68)
StackViewExample.zip

config.imageView.image is nil

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.

iPhone X support needed

Expected behavior

The image view should shown in the center of the screen with close button properly in the top left corner

Actual behavior

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

Steps to reproduce the behavior

Tap on the image view that has simple image viewer set up

iOS 13: different behavior when tapping to close or dragging to close

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.