A snappy image viewer with zoom and interactive dismissal transition.

Overview

SimpleImageViewer CI Status Swift 4.0 Carthage compatible Version Platforms iOS

A snappy image viewer with zoom and interactive dismissal transition.

SimpleImageViewer

Features

  • Double tap to zoom in/out
  • Interactive dismissal transition
  • Animate in from thumbnail image or fade in
  • Show activity indicator until image block is returned with new image
  • Animate from thumbnail image view with all kinds of content modes

Get started!

Carthage

To install SimpleImageViewer into your Xcode project using Carthage, specify it in your Cartfile:

github "aFrogleap/SimpleImageViewer" ~> 1.1.1

Cocoapods

To install SimpleImageViewer into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'SimpleImageViewer', '~> 1.1.1'

Swift Package Manager

To install SimpleImageViewer into your Xcode project using Swift Package Manager, specify it in your Package.swift file:

dependencies: [
    .Package(url: "https://github.com/aFrogleap/SimpleImageViewer.git", majorVersion: 1)
]

Sample Usage

let configuration = ImageViewerConfiguration { config in
    config.imageView = someImageView
}

let imageViewerController = ImageViewerController(configuration: configuration)

present(imageViewerController, animated: true)

Communication

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

License

SimpleImageViewer is available under the MIT license. See the LICENSE file for more info.

Copyright (c) 2017 aFrogleap

Comments
  • ImageBlock

    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

    opened by hbhasin1 9
  • Could not load the

    Could not load the "closeButton" image referenced from a nib in the bundle with identifier "org.cocoapods.SimpleImageViewer"

    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.

    opened by eastswift 4
  • How to use config.imageBlock ?

    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!

    opened by lemonlab 3
  • graphic issue on iPhone X

    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

    opened by alessunder 2
  • Swipe image out of screen to go back, where image orientation is dynamic

    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

    enhancement 
    opened by warnaars 2
  • Xcode 10.3 fix

    Xcode 10.3 fix

    When building our app in Xcode 10.3, it wouldn't compile because of a problem with ImageViewerController.xib in SimpleImageViewer. This was fixed by just opening and saving the xib using Xcode 10.3. I've also updated the build settings to Swift 5.

    opened by mbernson 1
  • Added swift_version parameter

    Added swift_version parameter

    Fixes # . Newer cocoapods releases recommend specifying a swift_version parameter in podspec file. Changes proposed in this pull request:

    • added said parameter
    opened by kaygro 1
  • Missing .swift_version parameter in podspec

    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.

    opened by kaygro 1
  • Corner radius animation

    Corner radius animation

    In most modern apps some images showing as a circles. Animation of the transition in such case doesn't look nice. By adding new boolean flag to the configuration and slight change in transitions logic I made it possible to resolve this problem. Maybe it'll be useful for other developers too.

    opened by azatZ 1
  • iPhone X support needed

    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

    opened by xanderbuck 1
  • Working delay on tableview

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

    opened by satoshinosekai 1
  • Crash reported by Crashlytics

    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

    opened by DaniArnaout 0
  • How to change the presented image background colour to transparent with alpha 0.5?

    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

    opened by saikishoreagrapalem 0
  • I get the following error when I try to add to the swift package manager.

    I get the following error when I try to add to the swift package manager.

    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.

    opened by rezwan-islam 0
  • #fix ios 13-image dragging

    #fix ios 13-image dragging

    Fixes #.

    Changes proposed in this pull request:

    • Fix Image transaction while dragging, which caused a problem that hides some parts of the previous view in a specific ios versions from ios 13 to upper versions.
    opened by karim-8 3
  • iOS 13: different behavior when tapping to close or dragging to close

    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!

    opened by KevinQuisquater 2
Releases(1.1.1)
Owner
Lucas
Lucas
Image slide-show viewer with multiple predefined transition styles, with ability to create new transitions with ease.

ATGMediaBrowser ATGMediaBrowser is an image slide-show viewer that supports multiple predefined transition styles, and also allows the client to defin

null 200 Dec 19, 2022
Zoomable - A container that allows you to zoom in and out of an image using only SwiftUI

Zoomable It is a container that allows you to zoom in and out of an image using

jasu 48 Nov 28, 2022
Simple UIView to interact with an Image view like scroll, zoom, pinch and crop.

Welcome to Interactive Image View, a simple library that provides an easier way to interact with image view, like scroll, zoom and crop. In its core i

Egzon Pllana 23 Nov 7, 2022
DTPhotoViewerController - A fully customizable photo viewer ViewController to display single photo or collection of photos, inspired by Facebook photo viewer.

DTPhotoViewerController Example Demo video: https://youtu.be/aTLx4M4zsKk DTPhotoViewerController is very simple to use, if you want to display only on

Tung Vo 277 Dec 17, 2022
Image viewer (or Lightbox) with support for local and remote videos and images

Table of Contents Features Focus Browse Rotation Zoom tvOS Setup Installation License Author Features Focus Select an image to enter into lightbox mod

Nes 534 Jan 3, 2023
Photo Browser / Viewer inspired by Facebook's and Tweetbot's with ARC support, swipe-to-dismiss, image progress and more

IDMPhotoBrowser IDMPhotoBrowser is a new implementation based on MWPhotoBrowser. We've added both user experience and technical features inspired by F

Thiago Peres 2.7k Dec 21, 2022
Lightbox is a convenient and easy to use image viewer for your iOS app

Lightbox is a convenient and easy to use image viewer for your iOS app, packed with all the features you expect: Paginated image slideshow. V

HyperRedink 1.5k Dec 22, 2022
Swift image slideshow with circular scrolling, timer and full screen viewer

?? ImageSlideshow Customizable Swift image slideshow with circular scrolling, timer and full screen viewer ?? Example To run the example project, clon

Petr Zvoníček 1.7k Dec 21, 2022
Slide image viewer library similar to Twitter and LINE.

Overview You can use it simply by passing the necessary information! Serrata is a UI library that allows you to intuitively view images. Features King

Takuma Horiuchi 324 Dec 9, 2022
Agrume - 🍋 An iOS image viewer written in Swift with support for multiple images.

Agrume An iOS image viewer written in Swift with support for multiple images. Requirements Swift 5.0 iOS 9.0+ Xcode 10.2+ Installation Use Swift Packa

Jan Gorman 601 Dec 26, 2022
An image viewer à la Twitter

For the latest changes see the CHANGELOG Install CocoaPods pod 'ImageViewer' Carthage github "Krisiacik/ImageViewer" Sample Usage For a detailed examp

Kristian Angyal 2.4k Dec 29, 2022
A simple mesh viewer for MacOS based on Swift and Metal and using Assimp for loading meshes

Metal Mesh Viewer A simple triangle mesh viewer for MacOS This application is a simple (triangle) mesh viewer that should be capable of rendering even

J. Andreas Bærentzen 0 Dec 13, 2021
An iOS/tvOS photo gallery viewer, useful for viewing a large (or small!) number of photos.

This project is unmaintained. Alex passed away in an accident in late 2019. His love of iOS development will always be remembered. AXPhotoViewer AXPho

Alex Hill 596 Dec 30, 2022
Simple PhotoBrowser/Viewer inspired by facebook, twitter photo browsers written by swift

SKPhotoBrowser [![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-) Simple PhotoBrowser

keishi suzuki 2.4k Jan 6, 2023
Swift/iOS viewer for photography galleries or portfolios

Swift/iOS viewer for photography galleries or portfolios. The app is intended for photographers who participate in classical photo clubs: a portfolio covers (curated) images that were presented and critiqued within a photo club.

Peter van den Hamer 8 Dec 24, 2022
Twitter Image Pipeline is a robust and performant image loading and caching framework for iOS clients

Twitter Image Pipeline (a.k.a. TIP) Background The Twitter Image Pipeline is a streamlined framework for fetching and storing images in an application

Twitter 1.8k Dec 17, 2022
📷 A composable image editor using Core Image and Metal.

Brightroom - Composable image editor - building your own UI Classic Image Editor PhotosCrop Face detection Masking component ?? v2.0.0-alpha now open!

Muukii 2.8k Jan 3, 2023
An image download extension of the image view written in Swift for iOS, tvOS and macOS.

Moa, an image downloader written in Swift for iOS, tvOS and macOS Moa is an image download library written in Swift. It allows to download and show an

Evgenii Neumerzhitckii 330 Sep 9, 2022
📷 A composable image editor using Core Image and Metal.

Brightroom - Composable image editor - building your own UI Classic Image Editor PhotosCrop Face detection Masking component ?? v2.0.0-alpha now open!

Muukii 2.8k Jan 2, 2023