WWDC2013_218 内容概要 ( 3 )

WWDC2013_218 —— 

Custom Transitions Using View Controllers ( 3 )


官方视频地址:https://developer.apple.com/wwdc/videos/

此文为自己总结的官方视频的内容概要,正在学习ing...


Interactive view controller transitions

1. Adding interactivity to custom transitions

• UINavigationController

   ■ Interactive pop gesture is pervasive on iOS 7.0

• Applications can define their own interactive transitions 

    Interactive transitions need not be gesture driven

    Interactive transitions usually run forwards and backwards 

     Often a transition can start and be cancelled

• UIKit provides a concrete interaction controller class 

    UIPercentDrivenInteractiveTransition

https://developer.apple.com/library/ios/documentation/uikit/reference/UIPercentDrivenInteractiveTransition_class/Reference/Reference.html

Accessing Transition Attributes

completionCurve property

duration  property

percentComplete property

completionSpeed property

Managing a Transition

– updateInteractiveTransition:

– cancelInteractiveTransition

– finishInteractiveTransition


2. Special support for UICollectionViews 

• UICollectionView

https://developer.apple.com/library/ios/documentation/uikit/reference/UICollectionView_class/Reference/Reference.html

Changing the Layout

   collectionViewLayout  property

– setCollectionViewLayout:animated:

– setCollectionViewLayout:animated:completion:

– startInteractiveTransitionToCollectionViewLayout:completion:

– finishInteractiveTransition

– cancelInteractiveTransition


•UICollectionViewDelegate

https://developer.apple.com/library/ios/documentation/uikit/reference/UICollectionViewDelegate_protocol/Reference/Reference.html

Providing a Transition Layout ( Does not replace– setCollectionViewLayout:animated: )

– collectionView:transitionLayoutForOldLayout:newLayout:


• UICollectionViewTransitionLayout 

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UICollectionViewTransitionLayout_class/Reference/Reference.html

Initializing the Transition Layout Object

– initWithCurrentLayout:nextLayout:

Updating the Transition Information

   transitionProgress  property

– updateValue:forAnimatedKey:

– valueForAnimatedKey:

Accessing the Layout Objects

   currentLayout  property

   nextLayout  property

Canceling and coordinating transitions

1. Canceling transitions

• Don’t assume that viewDidAppear follows viewWillAppear


2. UITransitionCoordinator

you can get a transition coordinator for an out of the box navigation controller transition.  It will also work for present and dismiss.

<UIViewControllerTransitionCoordinator>

• The transitionCoordinator does even more

Allows completion handlers to be registered for transitions

Allows other animations to run alongside the transition animation

• In addition to custom transitions on iOS 7

UINavigationController transitions have an associated transition coordinator

Present and Dismiss transitions have an associated coordinator

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewControllerTransitionCoordinator_Protocol/Reference/Reference.html

Responding to View Controller Transition Progress (218视屏讲解以下方法为optional,实为required )

  • – animateAlongsideTransition:completion: required method
  • – animateAlongsideTransitionInView:animation:completion: required method
  • – notifyWhenInteractionEndsUsingBlock:required method

<UIViewControllerTransitionCoordinatorContext>

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewControllerTransitionCoordinatorContext_Protocol/Reference/Reference.html



你可能感兴趣的:(custom,transitions,WWDC2013)