Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5599796e9d | |||
| 33449c84a0 | |||
| 458b246013 | |||
| a58a170979 | |||
| e4c43569de | |||
| 966e1c9976 | |||
| 1241215e53 | |||
| 09070849d8 | |||
| 8705078fa5 | |||
| 48a39b4573 | |||
| 3611a6f5b8 | |||
| 701d482714 | |||
| 9574c37479 | |||
| 52faf9a7e1 | |||
| ef0c5fceed | |||
| eab7e274e8 | |||
| f9ec208e36 | |||
| 6b9607fc9a | |||
| 8ad4b3a4d9 | |||
| b0357d3f54 | |||
| 7a30c5441e | |||
| 13e3d504f1 | |||
| 02578a894a | |||
| 2e54a9d21a | |||
| d31f4419e1 |
@@ -1,5 +1,4 @@
|
||||
<!--- Provide a general summary of your changes in the Title above -->
|
||||
<!--- IF YOU DELETE OR IGNORE THIS TEMPLATE WHEN OPENING A NEW ISSUE, YOUR ISSUE WILL BE IGNORED -->
|
||||
<!--- IF YOU DELETE OR IGNORE THIS TEMPLATE YOUR ISSUE WILL BE IGNORED AND CLOSED -->
|
||||
## New Issue Checklist
|
||||
<!--- Please complete all of the checks below before submitting a new issue (complete a check by marking it [x] with no spaces) -->
|
||||
I have read the [guidelines for contributing](https://github.com/jonkykong/SideMenu/blob/master/.github/CONTRIBUTING.md) and I understand:
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11542" systemVersion="16B2555" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="yAA-s6-Bam">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="yAA-s6-Bam">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
|
||||
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
@@ -15,7 +15,7 @@
|
||||
<objects>
|
||||
<navigationController id="yAA-s6-Bam" sceneMemberID="viewController">
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" barStyle="black" id="Bue-4e-bCJ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<gestureRecognizers/>
|
||||
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
@@ -42,7 +42,7 @@
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LFJ-SB-Zp9">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="635"/>
|
||||
<rect key="frame" x="0.0" y="64" width="375" height="571"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DMn-tw-NTB">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="469"/>
|
||||
@@ -205,9 +205,9 @@
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="LFJ-SB-Zp9" firstAttribute="top" secondItem="0gg-po-Ih1" secondAttribute="topMargin" id="0T7-Dc-CaB"/>
|
||||
<constraint firstItem="LFJ-SB-Zp9" firstAttribute="leading" secondItem="0gg-po-Ih1" secondAttribute="leading" id="OsA-4z-Y7t"/>
|
||||
<constraint firstItem="ma4-O6-wOT" firstAttribute="top" secondItem="LFJ-SB-Zp9" secondAttribute="bottom" constant="8" id="UUi-lo-0RA"/>
|
||||
<constraint firstItem="LFJ-SB-Zp9" firstAttribute="top" secondItem="Rm7-bv-OCN" secondAttribute="bottom" id="W6M-QX-I2w"/>
|
||||
<constraint firstItem="ma4-O6-wOT" firstAttribute="centerX" secondItem="0gg-po-Ih1" secondAttribute="centerX" id="aia-PT-OH3"/>
|
||||
<constraint firstItem="LW0-9z-RHu" firstAttribute="top" secondItem="ma4-O6-wOT" secondAttribute="bottom" constant="8" id="d5Q-Sj-0Xz"/>
|
||||
<constraint firstItem="LFJ-SB-Zp9" firstAttribute="top" secondItem="Rm7-bv-OCN" secondAttribute="bottom" id="ssi-ps-a2k"/>
|
||||
@@ -252,7 +252,6 @@
|
||||
<navigationController storyboardIdentifier="LeftMenuNavigationController" navigationBarHidden="YES" id="DuX-EW-0mP" customClass="UISideMenuNavigationController" customModule="SideMenu" sceneMemberID="viewController">
|
||||
<navigationItem key="navigationItem" id="ipz-Lx-Wgf"/>
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" id="35F-wh-r6h">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</navigationBar>
|
||||
<userDefinedRuntimeAttributes>
|
||||
@@ -387,7 +386,6 @@
|
||||
<objects>
|
||||
<navigationController storyboardIdentifier="RightMenuNavigationController" navigationBarHidden="YES" id="z7k-fk-pfc" customClass="UISideMenuNavigationController" customModule="SideMenu" sceneMemberID="viewController">
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" id="qOd-yQ-2i8">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</navigationBar>
|
||||
<connections>
|
||||
@@ -589,7 +587,7 @@
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="a17-pq-WAQ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
|
||||
<state key="normal" title="Dismiss">
|
||||
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
|
||||
@@ -66,8 +66,12 @@ open class SideMenuManager : NSObject {
|
||||
|
||||
/// Prevents the same view controller (or a view controller of the same class) from being pushed more than once. Defaults to true.
|
||||
open static var menuAllowPushOfSameClassTwice = true
|
||||
|
||||
/// Width of the menu when presented on screen, showing the existing view controller in the remaining space. Default is 75% of the screen width.
|
||||
|
||||
/**
|
||||
Width of the menu when presented on screen, showing the existing view controller in the remaining space. Default is 75% of the screen width.
|
||||
|
||||
Note that each menu's width can be overridden using the `menuWidth` property on any `UISideMenuNavigationController` instance.
|
||||
*/
|
||||
open static var menuWidth: CGFloat = max(round(min((appScreenRect.width), (appScreenRect.height)) * 0.75), 240)
|
||||
|
||||
/// Duration of the animation when the menu is presented without gestures. Default is 0.35 seconds.
|
||||
@@ -76,8 +80,8 @@ open class SideMenuManager : NSObject {
|
||||
/// Duration of the animation when the menu is dismissed without gestures. Default is 0.35 seconds.
|
||||
open static var menuAnimationDismissDuration: Double = 0.35
|
||||
|
||||
/// Duration of the remaining animation when the menu is partially dismissed with gestures. Default is 0.2 seconds.
|
||||
open static var menuAnimationCompleteGestureDuration: Double = 0.20
|
||||
/// Duration of the remaining animation when the menu is partially dismissed with gestures. Default is 0.35 seconds.
|
||||
open static var menuAnimationCompleteGestureDuration: Double = 0.35
|
||||
|
||||
/// Amount to fade the existing view controller when the menu is presented. Default is 0 for no fade. Set to 1 to fade completely.
|
||||
open static var menuAnimationFadeStrength: CGFloat = 0
|
||||
@@ -115,6 +119,14 @@ open class SideMenuManager : NSObject {
|
||||
/// The animation initial spring velocity when a menu is displayed. Ignored when displayed with a gesture.
|
||||
open static var menuAnimationInitialSpringVelocity: CGFloat = 1
|
||||
|
||||
/**
|
||||
Automatically dismisses the menu when another view is pushed from it.
|
||||
|
||||
Note: to prevent the menu from dismissing when presenting, set modalPresentationStyle = .overFullScreen
|
||||
of the view controller being presented in storyboard or during its initalization.
|
||||
*/
|
||||
open static var menuDismissOnPush = true
|
||||
|
||||
/// -Warning: Deprecated. Use `menuPushStyle = .subMenu` instead.
|
||||
@available(*, deprecated, renamed: "menuPushStyle", message: "Use `menuPushStyle = .subMenu` instead.")
|
||||
open static var menuAllowSubmenus: Bool {
|
||||
|
||||
@@ -14,8 +14,22 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
|
||||
fileprivate var interactive = false
|
||||
fileprivate static weak var originalSuperview: UIView?
|
||||
fileprivate static weak var activeGesture: UIGestureRecognizer?
|
||||
fileprivate static var switchMenus = false
|
||||
|
||||
fileprivate static var switchMenus = false {
|
||||
didSet {
|
||||
if switchMenus {
|
||||
singleton.cancel()
|
||||
}
|
||||
}
|
||||
}
|
||||
fileprivate static var menuWidth: CGFloat {
|
||||
get {
|
||||
let overriddenWidth = viewControllerForMenu?.menuWidth ?? 0
|
||||
if overriddenWidth > CGFloat.ulpOfOne {
|
||||
return overriddenWidth
|
||||
}
|
||||
return SideMenuManager.menuWidth
|
||||
}
|
||||
}
|
||||
internal static let singleton = SideMenuTransition()
|
||||
internal static var presentDirection: UIRectEdge = .left
|
||||
internal static weak var tapView: UIView? {
|
||||
@@ -39,11 +53,7 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
|
||||
return
|
||||
}
|
||||
|
||||
if let menuShrinkBackgroundColor = SideMenuManager.menuAnimationBackgroundColor {
|
||||
statusBarView.backgroundColor = menuShrinkBackgroundColor
|
||||
} else {
|
||||
statusBarView.backgroundColor = UIColor.black
|
||||
}
|
||||
statusBarView.backgroundColor = SideMenuManager.menuAnimationBackgroundColor ?? UIColor.black
|
||||
statusBarView.isUserInteractionEnabled = false
|
||||
}
|
||||
}
|
||||
@@ -106,6 +116,8 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
|
||||
pan.isEnabled = false
|
||||
pan.isEnabled = true
|
||||
return
|
||||
} else if pan.state != .began && pan.state != .changed {
|
||||
activeGesture = nil
|
||||
}
|
||||
|
||||
// how much distance have we panned in reference to the parent view?
|
||||
@@ -137,7 +149,7 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
|
||||
}
|
||||
|
||||
let direction: CGFloat = SideMenuTransition.presentDirection == .left ? 1 : -1
|
||||
let distance = translation.x / SideMenuManager.menuWidth
|
||||
let distance = translation.x / menuWidth
|
||||
// now lets deal with different states that the gesture recognizer sends
|
||||
switch (pan.state) {
|
||||
case .began, .changed:
|
||||
@@ -146,11 +158,9 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
|
||||
} else if distance > 0 && SideMenuTransition.presentDirection == .right && SideMenuManager.menuLeftNavigationController != nil {
|
||||
SideMenuTransition.presentDirection = .left
|
||||
switchMenus = true
|
||||
singleton.cancel()
|
||||
} else if distance < 0 && SideMenuTransition.presentDirection == .left && SideMenuManager.menuRightNavigationController != nil {
|
||||
SideMenuTransition.presentDirection = .right
|
||||
switchMenus = true
|
||||
singleton.cancel()
|
||||
} else {
|
||||
singleton.update(min(distance * direction, 1))
|
||||
}
|
||||
@@ -165,10 +175,8 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
|
||||
singleton.update(0.9999)
|
||||
}
|
||||
singleton.finish()
|
||||
activeGesture = nil
|
||||
} else {
|
||||
singleton.cancel()
|
||||
activeGesture = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -184,7 +192,7 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
|
||||
|
||||
let translation = pan.translation(in: pan.view!)
|
||||
let direction:CGFloat = SideMenuTransition.presentDirection == .left ? -1 : 1
|
||||
let distance = translation.x / SideMenuManager.menuWidth * direction
|
||||
let distance = translation.x / menuWidth * direction
|
||||
|
||||
switch (pan.state) {
|
||||
|
||||
@@ -225,7 +233,7 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
|
||||
mainViewController.view.frame.origin.y = 0
|
||||
menuView.transform = .identity
|
||||
menuView.frame.origin.y = 0
|
||||
menuView.frame.size.width = SideMenuManager.menuWidth
|
||||
menuView.frame.size.width = menuWidth
|
||||
menuView.frame.size.height = mainViewController.view.frame.height // in case status bar height changed
|
||||
var statusBarFrame = UIApplication.shared.statusBarFrame
|
||||
let statusBarOffset = SideMenuManager.appScreenRect.size.height - mainViewController.view.frame.maxY
|
||||
@@ -241,7 +249,7 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
|
||||
|
||||
case .viewSlideOut:
|
||||
menuView.alpha = 1 - SideMenuManager.menuAnimationFadeStrength
|
||||
menuView.frame.origin.x = SideMenuTransition.presentDirection == .left ? 0 : mainViewController.view.frame.width - SideMenuManager.menuWidth
|
||||
menuView.frame.origin.x = SideMenuTransition.presentDirection == .left ? 0 : mainViewController.view.frame.width - menuWidth
|
||||
mainViewController.view.frame.origin.x = 0
|
||||
menuView.transform = CGAffineTransform(scaleX: SideMenuManager.menuAnimationTransformScaleFactor, y: SideMenuManager.menuAnimationTransformScaleFactor)
|
||||
|
||||
@@ -256,7 +264,7 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
|
||||
|
||||
case .menuDissolveIn:
|
||||
menuView.alpha = 0
|
||||
menuView.frame.origin.x = SideMenuTransition.presentDirection == .left ? 0 : mainViewController.view.frame.width - SideMenuManager.menuWidth
|
||||
menuView.frame.origin.x = SideMenuTransition.presentDirection == .left ? 0 : mainViewController.view.frame.width - menuWidth
|
||||
mainViewController.view.frame.origin.x = 0
|
||||
}
|
||||
}
|
||||
@@ -290,9 +298,9 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
|
||||
|
||||
menuView.alpha = 1
|
||||
menuView.transform = .identity
|
||||
menuView.frame.size.width = SideMenuManager.menuWidth
|
||||
menuView.frame.size.width = menuWidth
|
||||
let size = SideMenuManager.appScreenRect.size
|
||||
menuView.frame.origin.x = SideMenuTransition.presentDirection == .left ? 0 : size.width - SideMenuManager.menuWidth
|
||||
menuView.frame.origin.x = SideMenuTransition.presentDirection == .left ? 0 : size.width - menuWidth
|
||||
mainViewController.view.transform = .identity
|
||||
mainViewController.view.frame.size.width = size.width
|
||||
let statusBarOffset = size.height - menuView.bounds.height
|
||||
@@ -512,7 +520,7 @@ extension SideMenuTransition: UIViewControllerAnimatedTransitioning {
|
||||
let duration = transitionDuration(using: transitionContext)
|
||||
if interactive {
|
||||
UIView.animate(withDuration: duration,
|
||||
delay: 0,
|
||||
delay: duration, // HACK: If zero, the animation briefly flashes in iOS 11. UIViewPropertyAnimators (iOS 10+) may resolve this.
|
||||
options: .curveLinear,
|
||||
animations: {
|
||||
animate()
|
||||
@@ -541,6 +549,13 @@ extension SideMenuTransition: UIViewControllerAnimatedTransitioning {
|
||||
return presenting ? SideMenuManager.menuAnimationPresentDuration : SideMenuManager.menuAnimationDismissDuration
|
||||
}
|
||||
|
||||
open override func update(_ percentComplete: CGFloat) {
|
||||
guard !SideMenuTransition.switchMenus else {
|
||||
return
|
||||
}
|
||||
|
||||
super.update(percentComplete)
|
||||
}
|
||||
}
|
||||
|
||||
extension SideMenuTransition: UIViewControllerTransitioningDelegate {
|
||||
|
||||
@@ -9,6 +9,9 @@ import UIKit
|
||||
|
||||
open class UISideMenuNavigationController: UINavigationController {
|
||||
|
||||
/// Width of the menu when presented on screen, showing the existing view controller in the remaining space. Default is zero. When zero, `SideMenuManager.menuWidth` is used.
|
||||
@IBInspectable open var menuWidth: CGFloat = 0
|
||||
|
||||
internal var originalMenuBackgroundColor: UIColor?
|
||||
|
||||
open override func awakeFromNib() {
|
||||
@@ -84,17 +87,28 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if SideMenuManager.menuDismissOnPush {
|
||||
// We're presenting a view controller from the menu, so we need to hide the menu so it isn't showing when the presented view is dismissed.
|
||||
UIView.animate(withDuration: SideMenuManager.menuAnimationDismissDuration,
|
||||
delay: 0,
|
||||
usingSpringWithDamping: SideMenuManager.menuAnimationUsingSpringWithDamping,
|
||||
initialSpringVelocity: SideMenuManager.menuAnimationInitialSpringVelocity,
|
||||
options: SideMenuManager.menuAnimationOptions,
|
||||
animations: {
|
||||
SideMenuTransition.hideMenuStart()
|
||||
}) { (finished) -> Void in
|
||||
self.view.isHidden = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override open func viewDidDisappear(_ animated: Bool) {
|
||||
super.viewDidDisappear(animated)
|
||||
|
||||
// We're presenting a view controller from the menu, so we need to hide the menu so it isn't showing when the presented view is dismissed.
|
||||
if !isBeingDismissed {
|
||||
view.isHidden = true
|
||||
SideMenuTransition.hideMenuStart()
|
||||
}
|
||||
// Hack: force selection to get cleared on UITableViewControllers when reappearing using custom transitions
|
||||
visibleViewController?.viewWillAppear(false)
|
||||
}
|
||||
|
||||
override open func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
|
||||
@@ -113,20 +127,6 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
}
|
||||
}
|
||||
|
||||
override open func prepare(for segue: UIStoryboardSegue, sender: Any?) {
|
||||
if let presentingViewController = presentingViewController {
|
||||
presentingViewController.prepare(for: segue, sender: sender)
|
||||
}
|
||||
}
|
||||
|
||||
override open func shouldPerformSegue(withIdentifier identifier: String, sender: Any?) -> Bool {
|
||||
if let presentingViewController = presentingViewController {
|
||||
return presentingViewController.shouldPerformSegue(withIdentifier: identifier, sender: sender)
|
||||
}
|
||||
|
||||
return super.shouldPerformSegue(withIdentifier: identifier, sender: sender)
|
||||
}
|
||||
|
||||
override open func pushViewController(_ viewController: UIViewController, animated: Bool) {
|
||||
guard viewControllers.count > 0 && SideMenuManager.menuPushStyle != .subMenu else {
|
||||
// NOTE: pushViewController is called by init(rootViewController: UIViewController)
|
||||
@@ -135,9 +135,11 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
return
|
||||
}
|
||||
|
||||
let splitViewController = presentingViewController as? UISplitViewController
|
||||
let tabBarController = presentingViewController as? UITabBarController
|
||||
guard let navigationController = (tabBarController?.selectedViewController ?? presentingViewController) as? UINavigationController else {
|
||||
print("SideMenu Warning: attempt to push a View Controller from \(String(describing: presentingViewController.self)) where its navigationController == nil. It must be embedded in a Navigation Controller for this to work.")
|
||||
let potentialNavigationController = (splitViewController?.viewControllers.first ?? tabBarController?.selectedViewController) ?? presentingViewController
|
||||
guard let navigationController = potentialNavigationController as? UINavigationController else {
|
||||
print("SideMenu Warning: attempt to push a View Controller from \(String(describing: potentialNavigationController.self)) where its navigationController == nil. It must be embedded in a Navigation Controller for this to work.")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -146,7 +148,6 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
CATransaction.begin()
|
||||
CATransaction.setCompletionBlock( { () -> Void in
|
||||
self.dismiss(animated: true, completion: nil)
|
||||
self.visibleViewController?.viewWillAppear(false) // Hack: force selection to get cleared on UITableViewControllers when reappearing using custom transitions
|
||||
})
|
||||
|
||||
let areAnimationsEnabled = UIView.areAnimationsEnabled
|
||||
|
||||
@@ -14,6 +14,11 @@ open class UITableViewVibrantCell: UITableViewCell {
|
||||
fileprivate var vibrancySelectedBackgroundView:UIVisualEffectView = UIVisualEffectView()
|
||||
fileprivate var defaultSelectedBackgroundView:UIView?
|
||||
|
||||
// For registering with UITableView without subclassing otherwise dequeuing instance of the cell causes an exception
|
||||
public override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
}
|
||||
|
||||
required public init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder)
|
||||
|
||||
|
||||
@@ -9,20 +9,20 @@
|
||||
|
||||
> 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.*
|
||||
> * [Website](http://massappeal.co).
|
||||
> * Check out my [website](http://massappeal.co) to see some of my other projects.
|
||||
> * Building and maintaining this free library takes time. Help keep me awake and buy me a coffee ☕️ via [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).
|
||||
|
||||
## Overview
|
||||
|
||||
SideMenu is a simple and versatile side menu control written in Swift.
|
||||
* **It can be implemented in storyboard without a single line of [code](#code-less-storyboard-implementation).**
|
||||
* Four standard animation styles to choose from (there's even a parallax effect 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](https://developer.apple.com/library/content/featuredarticles/ViewControllerPGforiPhoneOS/CustomizingtheTransitionAnimations.html).
|
||||
* Animations use your view controllers, not snapshots.
|
||||
* Properly handles screen rotation and in-call status bar height changes.
|
||||
- [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 (there's even a parallax effect 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](https://developer.apple.com/library/content/featuredarticles/ViewControllerPGforiPhoneOS/CustomizingtheTransitionAnimations.html).
|
||||
- [x] Animations use your view controllers, not snapshots.
|
||||
- [x] Properly handles screen rotation and in-call status bar height changes.
|
||||
|
||||
Check out the example project to see it in action!
|
||||
### Preview Samples
|
||||
@@ -31,7 +31,7 @@ Check out the example project to see it in action!
|
||||
|  |  |  |  |
|
||||
|
||||
## Requirements
|
||||
* iOS 8 or higher
|
||||
- [x] iOS 8 or higher
|
||||
|
||||
## Installation
|
||||
### CocoaPods
|
||||
@@ -212,6 +212,14 @@ open static var menuAnimationUsingSpringWithDamping: CGFloat = 1
|
||||
/// The animation initial spring velocity when a menu is displayed. Ignored when displayed with a gesture.
|
||||
open static var menuAnimationInitialSpringVelocity: CGFloat = 1
|
||||
|
||||
/**
|
||||
Automatically dismisses the menu when another view is pushed from it.
|
||||
|
||||
Note: to prevent the menu from dismissing when presenting, set modalPresentationStyle = .overFullScreen
|
||||
of the view controller being presented in storyboard or during its initalization.
|
||||
*/
|
||||
open static var menuDismissOnPush = true
|
||||
|
||||
/**
|
||||
The blur effect style of the menu if the menu's root view controller is a UITableViewController or UICollectionViewController.
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "SideMenu"
|
||||
s.version = "2.3.2"
|
||||
s.version = "2.3.4"
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user