https://github.com/noppefoxwolf/drawerpresentation
https://github.com/noppefoxwolf/drawerpresentation
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/noppefoxwolf/drawerpresentation
- Owner: noppefoxwolf
- License: mit
- Created: 2024-01-19T11:40:22.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-26T23:00:37.000Z (over 1 year ago)
- Last Synced: 2024-10-27T00:19:18.878Z (over 1 year ago)
- Language: Swift
- Size: 820 KB
- Stars: 14
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```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.