GitHawkApp/ContextMenu
소개
Things 3에서 영감을 받은 iOS 컨텍스트 메뉴 UI입니다.
웹 및 앱 개발측정된 스타 증가
- in 24h
- 0
- in 7 days
- -1
- in 15 days
- -1
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Original
- Contextual menus with delightful animations and styles
- Total control over menu contents using your own
UIViewControllers - Tons of feature and interaction customizations
Installation
Just add ContextMenu to your Podfile and pod install. Done!
pod 'ContextMenu'
For Carthage, just add GitHawkApp/ContextMenu to your Cartfile and carthage bootstrap.
github "GitHawkApp/ContextMenu"
Usage
Show the menu from one of your UIViewControllers:
ContextMenu.shared.show(
sourceViewController: self,
viewController: MyContentViewController()
)
You must provide a custom UIViewController to display in the menu. The only requirement is that you must set preferredContentSize to size your content.
class MyContentViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
title = "Demo"
preferredContentSize = CGSize(width: 200, height: 200)
}
}

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.
@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.
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 menushadowRadiusandshadowOpacity: Appearance of the container shadowxPadding,yPadding,edgePadding: Padding from the source view and screen edgeoverlayColor: The color of the backgroundmotionEffect: 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
- Created with ❤️ by Ryan Nystrom
관련 프로젝트 살펴보기
불러오는 중…