diff --git a/README.md b/README.md index 222d130..325bca2 100644 --- a/README.md +++ b/README.md @@ -5,19 +5,19 @@ [![Platform](https://img.shields.io/cocoapods/p/SideMenu.svg?style=flat)](http://cocoapods.org/pods/SideMenu) ## Shameless Plugs -### If you like SideMenu, give it a ★ at the top right of this page. +### If you like SideMenu, give it a ★ at the top right of its [GitHub](https://github.com/jonkykong/SideMenu) page. My name is Jon Kent and I'm a freelance iOS designer, developer, and mobile strategist. I love coffee and play the drums. [**Hire me**](mailto:contact@jonkent.me?subject=Let's build something amazing.) to help you make cool stuff. I also have a [website](http://jonkent.me). ## Overview SideMenu is a simple and versatile side menu control written in Swift. -- [x] **It can be implemented in storyboard without a single line of [code](#code-less-storyboard-implementation).** -- [x] Four standard animation styles to choose from (even parallax if you want to get weird). -- [x] Highly customizable without needing to write tons of custom code. -- [x] Supports continuous swiping between side menus on boths sides in a single gesture. -- [x] Global menu configuration. Set-up once and be done for all screens. -- [x] Menus can be presented and dismissed the same as any other View Controller since this control uses custom transitions. +* **It can be implemented in storyboard without a single line of [code](#code-less-storyboard-implementation).** +* Four standard animation styles to choose from (even parallax if you want to get weird). +* Highly customizable without needing to write tons of custom code. +* Supports continuous swiping between side menus on boths sides in a single gesture. +* Global menu configuration. Set-up once and be done for all screens. +* Menus can be presented and dismissed the same as any other View Controller since this control uses custom transitions. Check out the example project to see it in action! @@ -27,7 +27,7 @@ Check out the example project to see it in action! ![](etc/InOut.gif) ## Requirements -- [x] iOS 8 or higher +* iOS 8 or higher ## Installation ### CocoaPods diff --git a/SideMenu.podspec b/SideMenu.podspec index dc4e708..a8b4d54 100644 --- a/SideMenu.podspec +++ b/SideMenu.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = "SideMenu" - s.version = "2.0.7" + s.version = "2.0.8" s.summary = "Simple side menu control for iOS in Swift inspired by Facebook. Right and Left sides. No coding required." # This description is used to generate tags and improve search results. diff --git a/SideMenu.xcodeproj/project.pbxproj b/SideMenu.xcodeproj/project.pbxproj index deba2e1..ec3a6a8 100644 --- a/SideMenu.xcodeproj/project.pbxproj +++ b/SideMenu.xcodeproj/project.pbxproj @@ -279,7 +279,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0800; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = jonkykong; TargetAttributes = { 7B48A0D21DCB2487002990A1 = { diff --git a/SideMenu.xcodeproj/xcshareddata/xcschemes/SideMenu.xcscheme b/SideMenu.xcodeproj/xcshareddata/xcschemes/SideMenu.xcscheme index 381b277..ddb1da7 100644 --- a/SideMenu.xcodeproj/xcshareddata/xcschemes/SideMenu.xcscheme +++ b/SideMenu.xcodeproj/xcshareddata/xcschemes/SideMenu.xcscheme @@ -1,6 +1,6 @@ Void in - // tell our transitionContext object that we've finished animating - if transitionContext.transitionWasCancelled { - let viewControllerForPresentedMenu = SideMenuTransition.viewControllerForPresentedMenu - - if self.presenting { - SideMenuTransition.hideMenuComplete() - } else { - SideMenuTransition.presentMenuComplete() - } - menuView?.isUserInteractionEnabled = true - - transitionContext.completeTransition(false) - - if SideMenuTransition.switchMenus { - SideMenuTransition.switchMenus = false - viewControllerForPresentedMenu?.present(SideMenuTransition.presentDirection == .left ? SideMenuManager.menuLeftNavigationController! : SideMenuManager.menuRightNavigationController!, animated: true, completion: nil) - } - - return - } + }) { (finished) -> Void in + // tell our transitionContext object that we've finished animating + if transitionContext.transitionWasCancelled { + let viewControllerForPresentedMenu = SideMenuTransition.viewControllerForPresentedMenu if self.presenting { + SideMenuTransition.hideMenuComplete() + } else { SideMenuTransition.presentMenuComplete() - menuView?.isUserInteractionEnabled = true - transitionContext.completeTransition(true) - switch SideMenuManager.menuPresentMode { - case .viewSlideOut, .viewSlideInOut: - container.addSubview(topView!) - case .menuSlideIn, .menuDissolveIn: - container.insertSubview(topView!, at: 0) - } - if let statusBarView = SideMenuTransition.statusBarView { - container.bringSubview(toFront: statusBarView) - } - - return + } + menuView?.isUserInteractionEnabled = true + + transitionContext.completeTransition(false) + + if SideMenuTransition.switchMenus { + SideMenuTransition.switchMenus = false + viewControllerForPresentedMenu?.present(SideMenuTransition.presentDirection == .left ? SideMenuManager.menuLeftNavigationController! : SideMenuManager.menuRightNavigationController!, animated: true, completion: nil) } - SideMenuTransition.hideMenuComplete() + return + } + + if self.presenting { + SideMenuTransition.presentMenuComplete() + menuView?.isUserInteractionEnabled = true transitionContext.completeTransition(true) - menuView?.removeFromSuperview() + switch SideMenuManager.menuPresentMode { + case .viewSlideOut, .viewSlideInOut: + container.addSubview(topView!) + case .menuSlideIn, .menuDissolveIn: + container.insertSubview(topView!, at: 0) + } + if let statusBarView = SideMenuTransition.statusBarView { + container.bringSubview(toFront: statusBarView) + } + + return + } + + SideMenuTransition.hideMenuComplete() + transitionContext.completeTransition(true) + menuView?.removeFromSuperview() } } @@ -450,7 +442,8 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition, UIViewContr } internal func applicationDidEnterBackgroundNotification() { - if let menuViewController: UINavigationController = SideMenuTransition.presentDirection == .left ? SideMenuManager.menuLeftNavigationController : SideMenuManager.menuRightNavigationController { + if let menuViewController: UINavigationController = SideMenuTransition.presentDirection == .left ? SideMenuManager.menuLeftNavigationController : SideMenuManager.menuRightNavigationController, + menuViewController.presentedViewController == nil { SideMenuTransition.hideMenuStart() SideMenuTransition.hideMenuComplete() menuViewController.dismiss(animated: false, completion: nil)