Code Monkey home page Code Monkey logo

zoomtransitioning's Introduction

ZoomTransitioning

Join the chat at https://gitter.im/WorldDownTown/ZoomTransitioning

License Swift Carthage compatible CocoaPods compatible CocoaPods Awesome

Overview

ZoomTransitioning provides a custom transition with image zooming animation. When you use this library with UINavigationController, you can pop view controller with edge swiping.

Demo

Run the demo project in the Demo directory without carthage update or pod install.

Usage

Refer to the example project for details.

import ZoomTransitioning

Adopt ZoomTransitionSourceDelegate to source view controller

extension ImageListViewController: ZoomTransitionSourceDelegate {

    func transitionSourceImageView() -> UIImageView {
        return selectedImageView
    }

    func transitionSourceImageViewFrame(forward forward: Bool) -> CGRect {
        return selectedImageView.convertRect(selectedImageView.bounds, toView: view)
    }

    func transitionSourceWillBegin() {
        selectedImageView.hidden = true
    }

    func transitionSourceDidEnd() {
        selectedImageView.hidden = false
    }

    func transitionSourceDidCancel() {
        selectedImageView.hidden = false
    }
}

Adopt ZoomTransitionDestinationDelegate to destination view controller

extension ImageDetailViewController: ZoomTransitionDestinationDelegate {

    func transitionDestinationImageViewFrame(forward forward: Bool) -> CGRect {
        if forward {
            let x: CGFloat = 0.0
            let y = topLayoutGuide.length
            let width = view.frame.width
            let height = width * 2.0 / 3.0
            return CGRect(x: x, y: y, width: width, height: height)
        } else {
            return largeImageView.convertRect(largeImageView.bounds, toView: view)
        }
    }

    func transitionDestinationWillBegin() {
        largeImageView.hidden = true
    }

    func transitionDestinationDidEnd(transitioningImageView imageView: UIImageView) {
        largeImageView.hidden = false
        largeImageView.image = imageView.image
    }

    func transitionDestinationDidCancel() {
        largeImageView.hidden = false
    }
}

set delegate property of UINavigationController

import ZoomTransitioning

class NavigationController: UINavigationController {

    private let zoomNavigationControllerDelegate = ZoomNavigationControllerDelegate()

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)

        delegate = zoomNavigationControllerDelegate
    }
}

Requirements

  • Swift 4.0
  • iOS 9.0 or later

If you use Swift 2.2, use 1.3.0

Installation

Carthage

ZoomTransitioning is available through Carthage. To install it, simply add the following line to your Cartfile:

github "WorldDownTown/ZoomTransitioning"

CocoaPods

ZoomTransitioning is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'ZoomTransitioning'

Manually

  1. Download and drop /ZoomTransitioningfolder in your project.
  2. Congratulations!

Author

WorldDownTown, [email protected]

License

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

zoomtransitioning's People

Contributors

gitter-badger avatar lfarah avatar winddpan avatar worlddowntown 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zoomtransitioning's Issues

Navigation Controller Interactive pop gesture in IOS10

Hi! This is great work. Congrats!
I'm working on a project for IOS10. I'm not using ZoomTransitioning, but I do use your approach to retrieve the navigation controller's default interactivePopGesture recogniser and tie it to the behavior of my own gesture, which drives my custom transition.
It worked great on IOS9 but not at all in IOS10.
At first i thought there was something wrong with my code, but I tried your zoomTransitioning Demo and it showed the same result as mine: on IOS10 the edge pan gesture drives the default pop animation and not the custom animation transition :(
I tried to fix this with some fine tuning of the ZoomInteractiveTransition gesture delegate but nothing worked. I can't see anything wrong with the code.
Was wondering if you might know of a fix.
Thanks!

Can't go back from collectionViewController and Animation not working if the inheritance is more than 2 ViewControllers

(A)TabBarController --> (B)Navigation Controller --> (C)ViewController -> (D)TableViewController -> (E)ZoomNavigationController -> (F)CollectionViewController -> (G)DetailViewController

  1. It works but I can't go back from (F) to (D) (the back button is not showing up)
  2. Tabbar has been disappeared.

I have tried to Put ZoomNavigationController before (D) but the animation does not work.

Objective-c

Could you provide an objective-c exemple, please?

Update Swift 4

Is it possible to have the update for Swift 4 & Xcode 9.1 ?

Unable to find pod

After trying:

pod 'ZoomTransitioning'

I get

[!] Unable to find a specification for 'ZoomTransitioning'

on cocopaods version 1.0.1

Requirements iOS version

Hello.

I have a question about the requirements iOS version.
Requirements version and read the README. Wrote 8.0,
But you are prompted to 9.3 or more iOS versions when you build the project.
This is the error.

Module file's minimum deployment target is ios9.3 v9.3: /Users/hikaru/ios/test/Carthage/Build/iOS/ZoomTransitioning.framework/Modules/ZoomTransitioning.swiftmodule/x86_64.swiftmodule

2016-09-20 23 34 59

Also deploy version when you check here has become to 9.3.
https://github.com/WorldDownTown/ZoomTransitioning/blob/master/ZoomTransitioning.xcodeproj/project.pbxproj#L201

Is it possible to build in less than 9.3?
2016-09-20 23 35 13

Version of Xcode is using 7.3.1.

About zoomTransition from round imageView to another round ImageView

HI, I have a round image view transition to another round imageview,
Before transition the imageView will show rectangle imageView.
Then do the transition.
And before finished it still a rectangle imageview then hidden.

Is any hint that I can do it with round ImageView?

Thank you very much. This Framework is awesome.

Device orientation bug

Hi there,
I've noticed that there is bug when device orientation comes into place. To reproduce the error select an image from the main view, it takes you to destination controller, then change device orientation and go back, the collection view stays in the previous orientation and do not updates. Could you advice a solution for this problem ?

Manual Installation

CocoaPods and Carthage are awesome tools and make our life really easier, but there are some devs who still don't know how to use them.

It would be cool to add the Manual installation guide in your README.md. You can take a look at my iOS Readme Template to see how you can do it.

Cocoapods is still delivering v1.1.2

Cocoapods is still dispensing v 1.1.2 of the repository instead of 1.4.0. My workaround is to use the direct link for now:

pod 'ZoomTransitioning', :git => 'https://github.com/WorldDownTown/ZoomTransitioning.git'

screen shot 2016-12-07 at 3 57 58 pm

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.