Pin code validators |
||
|---|---|---|
| .. | ||
| Assets | ||
| Sources | ||
| README.md | ||
| TITransitions.podspec | ||
README.md
TITransitions
Set of custom transitions to present controller.
PanelTransition
Use to present ViewController from the bottom.
Usage
let panelTransition = PanelTransition(presentStyle: .halfScreen)
let childController = UIViewController()
childController.view.backgroundColor = .white
childController.transitioningDelegate = panelTransition
childController.modalPresentationStyle = .custom
rootController.present(childController)
Customization
To customize panel transition behaviour use the PanelTransition's constructor.
PanelTransition(presentStyle: PresentStyle, //required
panelConfig: PanelPresentationController.Configuration = .default,
driver: TransitionDriver? = .init(),
presentAnimation: PresentAnimation = .init(),
dismissAnimation: DismissAnimation = .init())
-
PresentStyle - defines a position of ViewController:
- fullScreen
- halfScreen
- customInsets(UIEdgeInsets)
- customHeight(CGFloat)
-
PanelPresentationController.Configuration - defines a background color of back view and a tap gesture:
struct Configuration {
let backgroundColor: UIColor
let onTapDismissEnabled: Bool
let onTapDismissCompletion: VoidClosure?
- TransitionDriver is responsible for swipe gesture.
- PresentAnimation and DismissAnimation defines present and dismiss animations.
Installation via SPM
You can install this framework as a target of LeadKit.
License
TITransitions is available under the Apache License 2.0. See the LICENSE file for more info.