-
Notifications
You must be signed in to change notification settings - Fork 14
/
StateViewControllerTransitioning.swift
37 lines (29 loc) · 1.45 KB
/
StateViewControllerTransitioning.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#if canImport(UIKit)
import UIKit
/// View controllers can conform to this protocol to provide their desired
/// state transitioning behaviour when contained in a `StateViewController`.
public protocol StateViewControllerTransitioning: AnyObject {
/// Returns the animation duration for a state transition of this view controller.
///
/// - Parameter isAppearing: Whether this view controller is appearing.
/// - Returns: A transition duration.
func stateTransitionDuration(isAppearing: Bool) -> TimeInterval
/// Notifies that a state transition will begin for this view controller.
///
/// - Parameter isAppearing: Whether this view controller is appearing.
func stateTransitionWillBegin(isAppearing: Bool)
/// Notifies that a state transition did end for this view controller.
///
/// - Parameter isAppearing: Whether this view controller is appearing.
func stateTransitionDidEnd(isAppearing: Bool)
/// Animations performed alongside the state transition of this view controller.
///
/// - Parameter isAppearing: Whether this view controller is appearing.
func animateAlongsideStateTransition(isAppearing: Bool)
/// Returns the animation delay for a state transition of the provided view controller.
///
/// - Parameter isAppearing: Whether this view controller is appearing.
/// - Returns: A transition duration.
func stateTransitionDelay(isAppearing: Bool) -> TimeInterval
}
#endif