Library for smooth animation of images during transitions.

Overview

ImageTransition

Build Status Cocoapods Carthage compatible Swift Version GitHub codebeat badge

ImageTransition is a library for smooth animation of images during transitions.

Something looks like below:

e.g. UIImageView e.g. UIImageView in UICollectionView
sample_01.gif sample_02.gif

Feature

  • Transition zooming animation like the iOS Photos app and the "Pinterest", and so on
  • Easy to use (conform to ImageTransitionable protocol)
  • Swifty (protocol-oriented)
  • Animation configuration customizable (animation duration, UIView.AnimationOptions)
  • CornerRadius animation (e.g. from a round image to a square Image)

Installation

Carthage

  • Add github "shtnkgm/ImageTransition" to your Cartfile.
  • Run carthage update.

CocoaPods

  • Add pod 'ImageTransition' to your podfile.
  • Run pod update.

Usage

  • Confirm ImageTransitionable protocol
// Source UIViewController
import ImageTransition
extension SourceViewController: ImageTransitionable {
    var imageViewForTransition: UIImageView? {
        return imageView
    }
}
// Destination UIViewController
import ImageTransition
extension DestinationViewController: ImageTransitionable {
    var imageViewForTransition: UIImageView? {
        return imageView
    }
}
  • Set Delegate
    // present / dismiss transition
    @objc private func imageViewDidTapped() {
        let destinationViewController = DestinationViewController.make()
        destinationViewController.transitioningDelegate = ImageTransitionDelegate.shared
        present(destinationViewController, animated: true, completion: nil)
    }

    // push / pop transition
    @objc private func imageViewDidTapped() {
        let destinationViewController = DestinationViewController.make()
        // Set ImageTransitionDelegate.shared to `delegate` property of UINavigationContoller
        navigationController?.delegate = ImageTransitionDelegate.shared
        navigationController?.pushViewController(destinationViewController, animated: true)
    }

Customize

You can customize the configuration of animation.

ImageTransitionDelegate.shared.presentDuration = 0.5
ImageTransitionDelegate.shared.dismissDuration = 0.5
ImageTransitionDelegate.shared.pushDuration = 0.5
ImageTransitionDelegate.shared.popDuration = 0.5
ImageTransitionDelegate.shared.presentAnimationOptions = [.curveLinear]
ImageTransitionDelegate.shared.dismissAnimationOptions = [.curveEaseIn]
ImageTransitionDelegate.shared.pushAnimationOptions = [.curveLinear]
ImageTransitionDelegate.shared.popAnimationOptions = [.curveEaseIn]

Requirements

  • iOS 9.0 or later

Contributing

Pull requests and stars are always welcome.

For bugs and feature requests, please create an issue.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

License

ImageTransition is released under the MIT license. See LICENSE for details.

You might also like...
A smooth, responsive and flexible messages UI library for iOS.
A smooth, responsive and flexible messages UI library for iOS.

AsyncMessagesViewController A smooth, responsive and flexible messages UI library for iOS apps. Built on top of the awesome Texture (formerly AsyncDis

A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles
A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles

A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles while pushing or popping a view controller for all orientations. And you don't need to write any line of code for it, it all happens automatically.

SwiftUI Animation Library. Useful SwiftUI animations including Loading/progress, Looping, On-off, Enter, Exit, Fade, Spin and Background animations that you can directly implement in your next iOS application or project. The library also contains huge examples of spring animations such as Inertial Bounce, Shake, Twirl, Jelly, Jiggle, Rubber Band, Kitchen Sink and Wobble effects. Browse, find and download the animation that fits your needs. SwiftUI-Text-Animation-Library - Text animation library for SwiftUI
SwiftUI-Text-Animation-Library - Text animation library for SwiftUI

⚠️ This repository is under construction. SwiftUI Text Animation Library Make yo

Convenient & secure logging during development & release in Swift 3, 4 & 5
Convenient & secure logging during development & release in Swift 3, 4 & 5

Colorful, flexible, lightweight logging for Swift 3, Swift 4 & Swift 5. Great for development & release with support for Console, File & cloud platfor

Xcode projects and sources created during HWS-Live workshop hosted by @twostraws

Hacking with Swift Live 2021 My Xcode projects and sources created during Hacking With Swift Live online-workshops hosted by @twostraws. Day 1 Various

Convenient & secure logging during development & release in Swift 3, 4 & 5
Convenient & secure logging during development & release in Swift 3, 4 & 5

Colorful, flexible, lightweight logging for Swift 3, Swift 4 & Swift 5. Great for development & release with support for Console, File & cloud platfor

Repository to store the projects made during the 100 Days of Swift challenge by Paul Hudson of Hacking with Swift.

100DaysOfSwift 📱 Repository to store the projects made during the 100 Days of Swift challenge by Paul Hudson of Hacking with Swift. Days 1-12: Introd

GraphQLite is a toolkit to work with GraphQL servers easily. It also provides several other features to make life easier during iOS application development.
GraphQLite is a toolkit to work with GraphQL servers easily. It also provides several other features to make life easier during iOS application development.

What is this? GraphQLite is a toolkit to work with GraphQL servers easily. It also provides several other features to make life easier during iOS appl

The code for my CoreGraphics+CoreAnimation talk, held during the 2012 iOS Game Design Seminar at the Technical University Munich.

PKCoreTechniques ======= Core Techniques is the result of a presentation I held at the Technical University of Munich during the 'iOS Game Design Semi

A MacOS app created to annoy users so users will go to bed during bedtime hours

A MacOS app created to annoy users so users will go to bed during bedtime hours. Developed for me as a school project.

This app has always been open source! It began with the Big Brain Hackathon and now during Hacktoberfest
This app has always been open source! It began with the Big Brain Hackathon and now during Hacktoberfest

Brain Marks This app has always been open source! It began with the Big Brain Hackathon and now during Hacktoberfest. It is available for free on the

Tipsy - Bill splitting and tip calculating App developed during iOS & Swift classes - The Complete App Development Bootcamp
Tipsy - Bill splitting and tip calculating App developed during iOS & Swift classes - The Complete App Development Bootcamp

Tipsy 💵 Bill splitting and tip calculating App developed during iOS & Swift cla

This was built during my bootcamp using SwiftUI, WebKit and an API from Hacker News

HackerNewsReader This was built during my bootcamp using SwiftUI, WebKit and an API from Hacker News. This was programmed from scratch with SwiftUI. I

❤️ Continuous heart rate measurement during workouts with watchOS 3.

Heart Control Monitor your heart rate on the apple watch - continuously and easy. What is it? Heart Control is a standalone watch app to monitor conti

Gliding Collection is a smooth, flowing, customizable decision for a UICollectionView Swift Controller.
Gliding Collection is a smooth, flowing, customizable decision for a UICollectionView Swift Controller.

A smooth, flowing, customizable decision for a UICollectionView Swift Controller We specialize in the designing and coding of custo

Blobmorphism is a brand new design language I've created to break free of the material overload in iOS, built in SwiftUI. Everything feels smooth and fluid.
Blobmorphism is a brand new design language I've created to break free of the material overload in iOS, built in SwiftUI. Everything feels smooth and fluid.

Blobmorphism is a brand new design language I've created to break free of the material overload in iOS, built in SwiftUI. Everything feels smooth and fluid.

*Random Smooth Cloudy* Noise for SwiftUI
*Random Smooth Cloudy* Noise for SwiftUI

Noise Generate random smooth cloudy noise. Install Swift Package .

Add smooth water waves to your views.
Add smooth water waves to your views.

WXWaveView Add pretty and smooth waves to your views! The wave can be added to any type of view. 中文说明 e.g. Integration Cocoapods: pod 'WXWaveView' Or

Comments
  •  Presenting viewcontroller with transitiondelegate was crashing the application

    Presenting viewcontroller with transitiondelegate was crashing the application

    hi @shtnkgm ,

    I was able to integrate your awesome library into my current project with navigationcontroller delegate it is working as expected whereas with preseting viewcontroller it got crashed. Could you please guide me how to figure it out to resolve this issue.

    Thank & Cheers, Pradeep kumar

    opened by pradweep 1
  • [ImgBot] Optimize images

    [ImgBot] Optimize images

    Beep boop. Your images are optimized!

    Your image file size has been reduced by 6% 🎉

    Details

    | File | Before | After | Percent reduction | |:--|:--|:--|:--| | /Sample/Assets.xcassets/strawberry.imageset/close-up-food-fruit-59945.jpg | 26.37kb | 22.95kb | 12.96% | | /Sample/Assets.xcassets/kiwi.imageset/food-fresh-fruit-51312.jpg | 27.01kb | 24.78kb | 8.27% | | /Sample/Assets.xcassets/lemon.imageset/acid-bright-citrus-1414110.jpg | 28.52kb | 26.76kb | 6.17% | | /Sample/Assets.xcassets/tomato.imageset/cherry-tomatoes-food-freshness-48802.jpg | 82.06kb | 77.63kb | 5.40% | | /Sample/Assets.xcassets/orange.imageset/citrus-food-fresh-42059.jpg | 34.82kb | 33.14kb | 4.81% | | /Sample/Assets.xcassets/apple.imageset/apple-food-fruit-39803.jpg | 35.88kb | 34.22kb | 4.61% | | | | | | | Total : | 234.65kb | 219.48kb | 6.46% |


    📝docs | :octocat: repo | 🙋issues | 🏅swag | 🏪marketplace

    opened by imgbot[bot] 0
  • [ImgBot] optimizes images

    [ImgBot] optimizes images

    Beep boop. Your images are optimized!

    Your image file size has been reduced by 7% 🎉

    Details

    | File | Before | After | Percent reduction | |:--|:--|:--|:--| | /Sample/Assets.xcassets/fruit.imageset/fruit.jpg | 688.44kb | 640.51kb | 6.96% |


    📝docs | :octocat: repo | 🙋issues | 🏅swag | 🏪marketplace

    opened by imgbot[bot] 0
Releases(0.5.2)
Owner
shtnkgm
Yahoo! JAPAN Engineer / OSS Developer / iOS Developer
shtnkgm
SamuraiTransition is an open source Swift based library providing a collection of ViewController transitions featuring a number of neat “cutting” animations.

SamuraiTransiton is a ViewController transition framework in Swift. It is an animation as if Samurai cut out the screen with a sword. transition types

hachinobu 273 Dec 29, 2022
A simple way to create custom interactive UIViewController transitions

EasyTransitions is a library that helps developers create custom interactive transitions using simple functions defined in a protocol and avoid handli

Marcos Griselli 1.6k Jan 1, 2023
Easy interactive interruptible custom ViewController transitions

Introduction Transition is a library that helps you build iOS view controller transitions. Implementing a nice interactive custom view controller tran

Touchwonders 2.6k Dec 20, 2022
Allows trendy transitions using swipe gesture such as "swipe back anywhere".

SwipeTransition allows trendy transitions using swipe gesture such as "swipe back". Try the demo on the web (appetize.io): https://appetize.io/app/peb

Tatsuya Tanaka 294 Dec 27, 2022
This component implements transition animation to crumble view-controller into tiny pieces.

StarWars Animation This component implements transition animation to crumble view-controller into tiny pieces. Check this project on dribbble. Also, r

Yalantis 3.7k Dec 29, 2022
Elegant transition library for iOS & tvOS

Hero is a library for building iOS view controller transitions. It provides a declarative layer on top of the UIKit's cumbersome transition APIs—makin

Hero Transitions 21.2k Jan 3, 2023
AlertTransition is a extensible library for making view controller transitions, especially for alert transitions.

AlertTransition AlertTransition is a extensible library for making view controller transitions, especially for alert transitions. Overview AlertTransi

Loopeer 570 Nov 29, 2022
Makes dealing with images buttery smooth.

ImageButter Image viewer for iOS that supports WebP. What is WebP? Find out more here. You can find more about why we created this here. Features Anim

Dollar Shave Club 397 Nov 19, 2022
A Float Input View with smooth animation and supporting icon and seperator written with Swift

RSFloatInputView Features Smooth animation using CoreText Support optional left icon Support optional seperator Configurable padding, size, fonts and

null 103 Nov 13, 2022
A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles

A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles while pushing or popping a view controller for all orientations. And you don't need to write any line of code for it, it all happens automatically.

Zhouqi Mo 3.3k Dec 21, 2022