A custom modal presentation supporting top offset, snap and drag.
[TOC]
Adding to project:
File > Swift Packages > Add Package Dependency
https://github.com/andriyyezerskiy/modalbottomsheet
Adding as dependancy to Swift Package:
.package(url: "https://github.com/andriyyezerskiy/modalbottomsheet", from: "1.0.0")
Implement following extension in the presenting ViewController:
extension MyViewController: UIViewControllerTransitioningDelegate {
func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? {
return AYOOModalBottomSheet(presentedViewController: presented, presenting: presenting, blurEffectStyle: .dark)
}
}
Initialise and present modal ViewController:
let viewController = ModalViewController()
viewController.modalPresentationStyle = .custom
viewController.transitioningDelegate = self
self.present(viewController, animated: true)
link |
Stars: 0 |
Last commit: 3 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics