An open API service indexing awesome lists of open source software.

https://github.com/noppefoxwolf/drawerpresentation


https://github.com/noppefoxwolf/drawerpresentation

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# DrawerPresentation

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

![](https://github.com/noppefoxwolf/DrawerPresentation/blob/main/.github/example.gif)

## Installation

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

## Usage

```swift

// 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](LICENSE) file for details.