DrawerPresentation is a library that provides a customizable drawer presentation style for iOS applications.
.target(
name: "YourProject",
dependencies: [
.package(url: "https://github.com/noppefoxwolf/DrawerPresentation", from: "1.0.0")
]
)
// Add Interaction
let interaction = DrawerInteraction(delegate: self)
view.addInteraction(interaction)
// Delegate Example
extension ViewController: DrawerInteractionDelegate {
func viewController(for interaction: DrawerInteraction) -> UIViewController {
self
}
func drawerInteraction(_ interaction: DrawerInteraction, widthForDrawer drawerViewController: UIViewController) -> CGFloat {
300
}
func drawerInteraction(_ interaction: DrawerInteraction, presentingViewControllerFor viewController: UIViewController) -> UIViewController? {
UIHostingController(rootView: Text("Interactive side menu"))
}
}
// Perform interaction manually
interaction.present()
// Using transitioningDelegate directly
self.transitionController = DrawerTransitionController(drawerWidth: 300)
let vc = UIHostingController(rootView: Text("Hello, World!!"))
vc.modalPresentationStyle = .custom
vc.transitioningDelegate = transitionController
present(vc, animated: true)Let people know how they can contribute into your project. A contributing guideline will be a big plus.
This project is licensed under the terms of the MIT license. See the LICENSE file for details.
