A view controller that supports the interactive dismissal by edge pan gesture or screen pan gesture from modal presentation.
Using Presentation | Using Presentation |
---|---|
Against the small application, a big application abolutely have a tons of transitions between view controllers.
In addition, the view controller migth be presented in navigation controller or modal presentation.
Which means that should support the both of presentations.
And also self.navigationController?.push
is not safe operation. (under the dependencies the context.)
Coordinator-pattern's purpose is solving those problems from complex transitions. However, even this pattern, it's hard to manage pushing and presenting view controller corresponding to the context.
FluidPresentation provides FluidViewController
as a primitive component.
It does animation like push or presentation in modal presentation transitioning.
And we can create hierarchy by using presentation context in UIKit.
For example, fullScreen
or currentContext
.
final class YourViewController: FluidViewController {
}
Presentation style
let viewController: YourViewController
present(viewController, animated: true, completion: nil)
Navigation style
let viewController: YourViewController
viewController.setIdiom(.navigationPush())
present(viewController, animated: true, completion: nil)
Presentation style
let viewController: YourViewController
let fluidViewController = FluidViewController(idiom: .presentation, bodyViewController: viewController)
present(fluidViewController, animated: true, completion: nil)
Navigation style
let viewController: YourViewController
let fluidViewController = FluidViewController(idiom: .navigationPush(), bodyViewController: viewController)
present(fluidViewController, animated: true, completion: nil)
NavigatedFluidViewController
displays UINavigationBar
as standalone using the view controller's navigationItem
.
βοΈ NavigationBar transitions as cross-dissolve if previous or next view controller is the type of
NavigatedFluidViewController
.
That makes the user can feel like using basic navigation system.
let viewController: YourViewController
let fluidViewController = NavigatedFluidViewController(idiom: .navigationPush(), bodyViewController: viewController)
present(fluidViewController, animated: true, completion: nil)
https://developer.apple.com/videos/play/wwdc2013/218/ https://developer.apple.com/videos/play/tech-talks/10869/
FluidPresentation is released under the MIT license.