Skip to content

noppefoxwolf/DrawerPresentation

Repository files navigation

DrawerPresentation

DrawerPresentation is a library that provides a customizable drawer presentation style for iOS applications.

Installation

.target(
    name: "YourProject",
    dependencies: [
        .package(url: "https://github.com/noppefoxwolf/DrawerPresentation", from: "1.0.0")
    ]
)

Usage

// 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)

Contributing

Let people know how they can contribute into your project. A contributing guideline will be a big plus.

Apps Using

License

This project is licensed under the terms of the MIT license. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages