## Customizations
### Display from a Source View
Animate the menu out from a button or view. `ContextMenu` will take care of layout so that your menu doesn't clip the screen.
```swift
@IBAction func onButton(_ sender: UIButton) {
ContextMenu.shared.show(
sourceViewController: self,
viewController: MyContentViewController(),
sourceView: sender
)
}
```
### Container Style & Display
Use `ContextMenu.Options` to change the appearance of the containing view.
```swift
ContextMenu.shared.show(
sourceViewController: self,
viewController: MenuViewController(),
options: ContextMenu.Options(containerStyle: ContextMenu.ContainerStyle(backgroundColor: .blue)),
sourceView: button
)
```
There's plenty more you can customize with `ContextMenu.ContainerStyle`:
- `cornerRadius`: The corner radius of the menu
- `shadowRadius` and `shadowOpacity`: Appearance of the container shadow
- `xPadding`, `yPadding`, `edgePadding`: Padding from the source view and screen edge
- `overlayColor`: The color of the background
- `motionEffect`: Respond to device gyroscope changes, similar to app icons on Springboard.app.
If you want more customizations, we will gladly accept a Pull Request!
## Acknowledgements
- Inspiration from [Things 3](https://culturedcode.com/things/)
- Created with ❤️ by [Ryan Nystrom](https://twitter.com/_ryannystrom)