OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // ====== New Architecture ===== |
| 6 // = This code is only used in the new iOS Chrome architecture. = |
| 7 // ============================================================================ |
| 8 |
| 9 #ifndef IOS_CHROME_BROWSER_UI_ANIMATORS_ZOOM_TRANSITION_ANIMATOR_H_ |
| 10 #define IOS_CHROME_BROWSER_UI_ANIMATORS_ZOOM_TRANSITION_ANIMATOR_H_ |
| 11 |
| 12 #import <UIKit/UIKit.h> |
| 13 |
| 14 #import "ios/chrome/browser/ui/animators/zoom_transition_delegate.h" |
| 15 |
| 16 // A transition animator object. The transition (for presentation) will begin |
| 17 // with the presented view occupying a rectangle supplied by the delegate, or |
| 18 // defaulting to a square in the center of the presenter's view. The |
| 19 // presentation animation will change the size of the rectangle to match the |
| 20 // final presented size. For dismissal, the same animation is done in reverse. |
| 21 @interface ZoomTransitionAnimator |
| 22 : NSObject<UIViewControllerAnimatedTransitioning> |
| 23 |
| 24 // YES if the receiver is used for a presentation, NO (the default) if used |
| 25 // for a dismissal. Calling code should set this before returning this object |
| 26 // for UIKit to use. |
| 27 @property(nonatomic, assign, getter=isPresenting) BOOL presenting; |
| 28 |
| 29 // Optional object that can be passed into the delegate to identify a specific |
| 30 // location. For example, an object in a table or collection view might have |
| 31 // its index path passed in so the delegate can map that to a screen location. |
| 32 @property(nonatomic, copy) NSObject* presentationKey; |
| 33 |
| 34 // Delegate that can supply a source/destination rect for the animation. |
| 35 @property(nonatomic, weak) id<ZoomTransitionDelegate> delegate; |
| 36 |
| 37 // Convenience method to set a delegate from an array of objects that might |
| 38 // implement the ZoomTransitionDelegate protocol. For example, either the |
| 39 // source or presenting view controller (or neither) might implement the |
| 40 // protocol. If |possibleDelegates| is empty, or if no object it contains |
| 41 // conforms to ZoomTransitionDelegate, then the receiver's delegate will be |
| 42 // nil. If multiple objects in |possibleDelegates| conforms to the protocol, |
| 43 // then the first one will become the receiver's delegate. |
| 44 - (void)selectDelegate:(NSArray<id<NSObject>>*)possibleDelegates; |
| 45 |
| 46 @end |
| 47 |
| 48 #endif // IOS_CHROME_BROWSER_UI_ANIMATORS_ZOOM_TRANSITION_ANIMATOR_H_ |
OLD | NEW |