GithubHelp home page GithubHelp logo

iamalchemist / solpresentingfun Goto Github PK

View Code? Open in Web Editor NEW

This project forked from soleares/solpresentingfun

0.0 2.0 0.0 2.35 MB

WWDC Session 218 Sample Code: Custom Transitions Using View Controllers

License: MIT License

Objective-C 100.00%

solpresentingfun's Introduction

SOLPresentingFun

SOLPresentingFun is sample code for WWDC Session 218: Custom Transitions Using View Controllers.

Apple didn't provide sample code for this session so it's recreated here for your perusal and enjoyment.

Storyboards are used as much as possible in this sample. This was done as an exercise and to verify that the new APIs worked with Storyboard segues.

Requires:
Xcode 5 or later
iOS 7 or later

Transitions

#Transitions

##Slide

A custom transition that slides a view controller in from an edge.

The transition is implemented in SOLSlideTransitionAnimator.

##Bounce A custom transition that slides a view controller in from an edge with bounce.

The transition is implemented in SOLBounceTransitionAnimator.

##Fold A custom transition that uses snapshots and keyframes to achieve a folding origami effect.

The transition is implemented in SOLFoldTransitionAnimator.

##Flow 1

A standard interactive transition that animates between collection view controllers and includes a standard interactive pop gesture (swipe right).

It uses a new property useLayoutToLayoutNavigationTransitions on UICollectionViewController.

##Drop A custom modal transition that shows how to combine custom transitions with UIKit Dynamics.

The transition is implemented in SOLDropTransitionAnimator.

##Options A custom modal transition that presents an in-app settings view controller.

The transition is implemented in SOLOptionsTransitionAnimator.

#Issues

I came across the following issues with the new API:

  1. UICollectionViewController.useLayoutToLayoutNavigationTransitions doesn't work properly with storyboard segues. This is why I push the collection view controller programmatically instead of with a segue. It doesn't transition to the third collection view when using segues. I believe this is due to an SDK bug.

  2. The keyframe animation API sometimes animates a snapshot's alpha value at the wrong time. I worked around this in SOLFoldTransitionAnimator by scaling down bottomLeftSnapshot in Keyframe 4 of the dismiss animation. I would have preferred to just set it's alpha to 0 in a prior keyframe but that didn't work. I filed a radar for this.

  3. Normally an unwind segue will pop/dismiss the view controller. This doesn't happen for custom modal transitions so the view controller needs to be programmatically dismissed in the unwind segue action. See the comments for -[SOLViewController unwindToViewController:] for more details.

  4. For standard interactive transitions like Flow 1, the navigation controller delegate can't be set otherwise the standard interactive pop gesture (swipe right) breaks. See the comments for -[SOLViewController prepareForSegue:] for more details.

solpresentingfun's People

Contributors

soleares avatar

Watchers

James Cloos avatar  avatar

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.