Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0d7cca5609 | |||
| 9dcfc25b48 | |||
| 017e97db18 | |||
| fbcee66c14 | |||
| ad47e8bff1 | |||
| b4042a562d | |||
| c7c6fdf64a | |||
| 02595f2b68 | |||
| a8f0d75e66 | |||
| fbe29c7756 | |||
| 61f1556d93 | |||
| ceb3e44c31 | |||
| 01987a9d5b | |||
| b1e83dc4a8 | |||
| 89d3048c09 | |||
| ddca756462 |
@@ -1 +0,0 @@
|
||||
3.0
|
||||
@@ -133,6 +133,9 @@ open class SideMenuManager: NSObject {
|
||||
|
||||
/// Forces menus to always animate when appearing or disappearing, regardless of a pushed view controller's animation.
|
||||
open var menuAlwaysAnimate = false
|
||||
|
||||
/// Automatically dismisses the menu when app goes to the background.
|
||||
open var menuDismissWhenBackgrounded = true
|
||||
|
||||
/// Default instance of SideMenuManager.
|
||||
public static let `default` = SideMenuManager()
|
||||
|
||||
@@ -363,16 +363,20 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
|
||||
return
|
||||
}
|
||||
|
||||
if let originalSuperview = originalSuperview, let mainViewController = mainViewController {
|
||||
if let originalSuperview = originalSuperview,
|
||||
let mainViewController = mainViewController,
|
||||
sideMenuManager.menuDismissWhenBackgrounded {
|
||||
originalSuperview.addSubview(mainViewController.view)
|
||||
}
|
||||
|
||||
if notification.name == UIApplication.didEnterBackgroundNotification {
|
||||
hideMenuStart().hideMenuComplete()
|
||||
menuViewController?.dismiss(animated: false, completion: nil)
|
||||
if sideMenuManager.menuDismissWhenBackgrounded {
|
||||
hideMenuStart().hideMenuComplete()
|
||||
menuViewController?.dismiss(animated: false, completion: nil)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
UIView.animate(withDuration: sideMenuManager.menuAnimationDismissDuration,
|
||||
delay: 0,
|
||||
usingSpringWithDamping: sideMenuManager.menuAnimationUsingSpringWithDamping,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
> Hi, I'm Jon Kent and I am an iOS designer, developer, and mobile strategist. I love coffee and play the drums.
|
||||
> * [**Hire me**](mailto:yo@massappeal.co?subject=Let's%20build%20something%20amazing) to help you make cool stuff. *Note: If you're having a problem with SideMenu, please open an [issue](https://github.com/jonkykong/SideMenu/issues/new) and do not email me.*
|
||||
> * Check out my [website](http://massappeal.co) to see some of my other projects.
|
||||
> * Building and maintaining this **free** library takes a lot of my time and **saves you time**. Please consider paying it forward by supporting me with a small amount to my [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=contact%40jonkent%2eme&lc=US¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted). (only **4** people have donated since inception 😕 but **thank you** to those who have!)
|
||||
> * Building and maintaining this **free** library takes a lot of my time and **saves you time**. Please consider paying it forward by supporting me with a small amount to my [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=contact%40jonkent%2eme&lc=US¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted). (only **4** people have donated since 12/23/15 😕 but **thank you** to those who have!)
|
||||
|
||||
* **[Overview](#overview)**
|
||||
* [Preview Samples](#preview-samples)
|
||||
@@ -137,16 +137,20 @@ let menuRightNavigationController = UISideMenuNavigationController(rootViewContr
|
||||
// let menuRightNavigationController = storyboard!.instantiateViewController(withIdentifier: "RightMenuNavigationController") as! UISideMenuNavigationController
|
||||
SideMenuManager.default.menuRightNavigationController = menuRightNavigationController
|
||||
|
||||
// Enable gestures. The left and/or right menus must be set up above for these to work.
|
||||
// (Optional) Enable gestures. The left and/or right menus must be set up above for these to work.
|
||||
// Note that these continue to work on the Navigation Controller independent of the view controller it displays!
|
||||
SideMenuManager.default.menuAddPanGestureToPresent(toView: self.navigationController!.navigationBar)
|
||||
SideMenuManager.default.menuAddScreenEdgePanGesturesToPresent(toView: self.navigationController!.view)
|
||||
|
||||
// (Optional) Prevent status bar area from turning black when menu appears:
|
||||
SideMenuManager.default.menuFadeStatusBar = false
|
||||
```
|
||||
Then from a button, do something like this:
|
||||
``` swift
|
||||
present(SideMenuManager.default.menuLeftNavigationController!, animated: true, completion: nil)
|
||||
|
||||
// Similarly, to dismiss a menu programmatically, you would do this:
|
||||
```
|
||||
To dismiss a menu programmatically, do something like this:
|
||||
``` swift
|
||||
dismiss(animated: true, completion: nil)
|
||||
```
|
||||
That's it.
|
||||
|
||||
+3
-2
@@ -8,7 +8,7 @@
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "SideMenu"
|
||||
s.version = "5.0.1"
|
||||
s.version = "5.0.2"
|
||||
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.
|
||||
@@ -28,7 +28,8 @@ Pod::Spec.new do |s|
|
||||
s.source = { :git => "https://github.com/jonkykong/SideMenu.git", :tag => s.version.to_s }
|
||||
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
|
||||
|
||||
s.ios.deployment_target = '8.0'
|
||||
s.ios.deployment_target = '10.0'
|
||||
s.swift_version = '4.2'
|
||||
|
||||
s.source_files = 'Pod/Classes/**/*'
|
||||
# s.resource_bundles = {
|
||||
|
||||
@@ -524,7 +524,6 @@
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
INFOPLIST_FILE = SideMenu/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MODULEMAP_FILE = "$(SRCROOT)/SideMenu/module.modulemap";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.jonkykong.SideMenu;
|
||||
@@ -546,7 +545,6 @@
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
INFOPLIST_FILE = SideMenu/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MODULEMAP_FILE = "$(SRCROOT)/SideMenu/module.modulemap";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.jonkykong.SideMenu;
|
||||
|
||||
Reference in New Issue
Block a user