iOS动态转换效果的菜单 FlowingMenu
jopen
9年前
FlowingMenu 是可以显示菜单流动和弹跳效果的交互视图转换。
Usage
At first, import FlowingMenu
import FlowingMenu
Then just add aFlowingMenuTransitionManagerobject that acts astransitioningDelegateof the view controller you want display:
let flowingMenuTransitionManager = FlowingMenuTransitionManager() override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { let vc = segue.destinationViewController vc.transitioningDelegate = flowingMenuTransitionManager }
If you want interactive transition you will need to implement theFlowingMenuDelegatemethods and defines the views which will interact with the gestures:
var menu: UIViewController? override func viewDidLoad() { super.viewDidLoad() // Add the pan screen edge gesture to the current view flowingMenuTransitionManager.setInteractivePresentationView(view) // Add the delegate to respond to interactive transition events flowingMenuTransitionManager.delegate = self } override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { let vc = segue.destinationViewController vc.transitioningDelegate = flowingMenuTransitionManager // Add the left pan gesture to the menu flowingMenuTransitionManager.setInteractiveDismissView(vc.view) // Keep a reference of the current menu menu = vc } // MARK: - FlowingMenu Delegate Methods func flowingMenuNeedsPresentMenu(flowingMenu: FlowingMenuTransitionManager) { performSegueWithIdentifier("PresentSegueName", sender: self) } func flowingMenuNeedsDismissMenu(flowingMenu: FlowingMenuTransitionManager) { menu?.performSegueWithIdentifier("DismissSegueName", sender: self) }