From 1d32cd1b7b2d16d986ad022971169029918a5a57 Mon Sep 17 00:00:00 2001 From: jonkykong Date: Tue, 5 Jan 2016 21:10:23 -0800 Subject: [PATCH 1/2] Update README.md --- README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4aad58b..f88a03c 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,7 @@ pod "SideMenu" ``` ## Usage -### Storyboard -*Note: you can only enable gestures with code.* - +### Storyboard Implementation 1. Create a Navigation Controller for a side menu. Set the custom class of the Navigation Controller to be `UISideMenuNavigationController` in the **Identity Inspector**. Create a Root View Controller for the Navigation Controller (shown as a UITableViewController below). Set up any Triggered Segues you want in that View Controller. ![](etc/Screenshot1.png) @@ -34,16 +32,17 @@ pod "SideMenu" 3. Add a UIButton or UIBarButton to a View Controller that you want to display the menu from. Set that button's Triggered Segues action to modally present the Navigation Controller from step 1. ![](etc/Screenshot3.png) -### Code +That's it. *Note: you can only enable gestures in code.* +### Code Implementation In your View Controller's `viewDidLoad` event, do something like this: ``` swift // Define the menus let leftMenuNavigationController = UIMenuNavigationController() leftMenuNavigationController.leftSide = true -// UILeftMenuNavigationController is a subclass of UINavigationController, so do any additional configuration of it here +// UIMenuNavigationController is a subclass of UINavigationController, so do any additional configuration of it here like setting it's viewControllers. SideMenuManager.menuLeftNavigationController = leftMenuNavigationController let rightMenuNavigationController = UIMenuNavigationController() -// UIRightMenuNavigationController is a subclass of UINavigationController, so do any additional configuration of it here +// UIMenuNavigationController is a subclass of UINavigationController, so do any additional configuration of it here like setting it's viewControllers. SideMenuManager.menuRightNavigationController = rightMenuNavigationController // Enable gestures. The left and/or right menus must be set up above for these to work. @@ -55,7 +54,7 @@ Then from a button, do something like this: ``` swift presentViewController(SideMenuManager.menuLeftNavigationController!, animated: true, completion: nil) ``` - +That's it. ### Customization Just type `SideMenuManager.menu...` and code completion will show you everything you can customize (defaults are shown below for reference): ``` swift @@ -83,7 +82,7 @@ menuAddPanGestureToPresent(toView toView: UIView) -> UIPanGestureRecognizer ``` ## Known Issues -Don't try to change the status bar appearance when presenting a menu. When used with quick gestures/animations, it causes the presentation animation to not complete properly and locks up the UI. See [radar 21961293](http://www.openradar.me/21961293) for more information. +Don't try to change the status bar appearance when presenting a menu. When used with quick gestures/animations, it causes the presentation animation to not complete properly and locks the UI. See [radar 21961293](http://www.openradar.me/21961293) for more information. ## License From 7e4b8365ee2dbbd31abdc16c9550dd0da7006ee5 Mon Sep 17 00:00:00 2001 From: Jon Kent Date: Wed, 6 Jan 2016 11:39:09 -0800 Subject: [PATCH 2/2] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f88a03c..71c0d8d 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ SideMenu is a simple and versatile side menu control written in Swift. The are three standard animation styles to choose from along with several other options for further customization if desired. It's highly customizable without needing to write tons of custom code, and **can be implemented in storyboard without a single line of code**. Check out the example project to see it in action. +PS: It makes me happy when you ★ this repo. + ![](etc/Preview.gif) ## Requirements