Compare commits
59 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 22a7723345 | |||
| 423b56b9ac | |||
| 06fbf875d0 | |||
| 9d9c22c786 | |||
| de1b010ac1 | |||
| d061bd178d | |||
| 93ddab1377 | |||
| 60854beac1 | |||
| 2e8740a91e | |||
| b387ef2dd7 | |||
| 22596320a3 | |||
| 9363b747d1 | |||
| baae6186d7 | |||
| c5f80f954c | |||
| 493fa9a7a1 | |||
| 2de8d7f758 | |||
| 62a37e20d1 | |||
| 7a799b94a8 | |||
| 3a01ab6398 | |||
| 5e4ab5e254 | |||
| 70715d6fa0 | |||
| 411bd59493 | |||
| 5e295d36eb | |||
| 6aa68df4ce | |||
| 5c292125a6 | |||
| 48eb4a2e3a | |||
| 9503c814d6 | |||
| 4dd4f54a8e | |||
| 7429a42c26 | |||
| df032e6072 | |||
| 3a7c74e2e0 | |||
| 900926f268 | |||
| f5e585857c | |||
| 1d96ef80b3 | |||
| 452b354e19 | |||
| 78a3a66a69 | |||
| 8fe0a23a38 | |||
| 3a873661c3 | |||
| 89fc05a324 | |||
| 453e110246 | |||
| b39142bc1a | |||
| a6bd743e99 | |||
| 749588918c | |||
| f5b6615c72 | |||
| 8804675b80 | |||
| b0a09a5b7d | |||
| f1e4efeb46 | |||
| aea7592d85 | |||
| 87edaf1d32 | |||
| d14a8d66b3 | |||
| 36e8131965 | |||
| 58318a638d | |||
| 06ea874cc6 | |||
| fd8437b181 | |||
| 8c0d6b636f | |||
| 44d1de7d48 | |||
| 287434b008 | |||
| c0ec53608f | |||
| 54a9f3887d |
@@ -0,0 +1,39 @@
|
||||
# iOS CircleCI 2.0 configuration file
|
||||
#
|
||||
# Check https://circleci.com/docs/2.0/ios-migrating-from-1-2/ for more details
|
||||
#
|
||||
version: 2
|
||||
jobs:
|
||||
build:
|
||||
|
||||
# Specify the Xcode version to use
|
||||
macos:
|
||||
xcode: "10.3.0"
|
||||
|
||||
steps:
|
||||
- checkout
|
||||
|
||||
# Install CocoaPods
|
||||
- run:
|
||||
name: Install CocoaPods
|
||||
command: pod install
|
||||
|
||||
# Build the app and run tests
|
||||
- run:
|
||||
name: Build and run tests
|
||||
command: fastlane scan
|
||||
environment:
|
||||
SCAN_DEVICE: iPhone Xʀ
|
||||
SCAN_SCHEME: SideMenu Example
|
||||
|
||||
# Collect XML test results data to show in the UI,
|
||||
# and save the same XML files under test-results folder
|
||||
# in the Artifacts tab
|
||||
- store_test_results:
|
||||
path: test_output/report.xml
|
||||
- store_artifacts:
|
||||
path: /tmp/test-results
|
||||
destination: scan-test-results
|
||||
- store_artifacts:
|
||||
path: ~/Library/Logs/scan
|
||||
destination: scan-logs
|
||||
@@ -22,6 +22,7 @@ class MainViewController: UIViewController {
|
||||
super.viewDidLoad()
|
||||
setupSideMenu()
|
||||
updateUI(settings: SideMenuSettings())
|
||||
updateMenus()
|
||||
}
|
||||
|
||||
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
|
||||
@@ -43,7 +44,7 @@ class MainViewController: UIViewController {
|
||||
private func updateUI(settings: SideMenuSettings) {
|
||||
let styles:[UIBlurEffect.Style] = [.dark, .light, .extraLight]
|
||||
if let menuBlurEffectStyle = settings.blurEffectStyle {
|
||||
blurSegmentControl.selectedSegmentIndex = styles.firstIndex(of: menuBlurEffectStyle) ?? 0
|
||||
blurSegmentControl.selectedSegmentIndex = (styles.firstIndex(of: menuBlurEffectStyle) ?? 0) + 1
|
||||
} else {
|
||||
blurSegmentControl.selectedSegmentIndex = 0
|
||||
}
|
||||
@@ -53,7 +54,7 @@ class MainViewController: UIViewController {
|
||||
menuScaleFactorSlider.value = Float(settings.presentationStyle.menuScaleFactor)
|
||||
presentingAlphaSlider.value = Float(settings.presentationStyle.presentingEndAlpha)
|
||||
presentingScaleFactorSlider.value = Float(settings.presentationStyle.presentingScaleFactor)
|
||||
screenWidthSlider.value = Float(settings.menuWidth / view.frame.width)
|
||||
screenWidthSlider.value = Float(settings.menuWidth / min(view.frame.width, view.frame.height))
|
||||
shadowOpacitySlider.value = Float(settings.presentationStyle.onTopShadowOpacity)
|
||||
}
|
||||
|
||||
@@ -88,7 +89,7 @@ class MainViewController: UIViewController {
|
||||
|
||||
var settings = SideMenuSettings()
|
||||
settings.presentationStyle = presentationStyle
|
||||
settings.menuWidth = view.frame.width * CGFloat(screenWidthSlider.value)
|
||||
settings.menuWidth = min(view.frame.width, view.frame.height) * CGFloat(screenWidthSlider.value)
|
||||
let styles:[UIBlurEffect.Style?] = [nil, .dark, .light, .extraLight]
|
||||
settings.blurEffectStyle = styles[blurSegmentControl.selectedSegmentIndex]
|
||||
settings.statusBarEndAlpha = blackOutStatusBar.isOn ? 1 : 0
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
//
|
||||
// ExampleTests.swift
|
||||
// ExampleTests
|
||||
//
|
||||
// Created by Jon Kent on 8/10/19.
|
||||
// Copyright © 2019 jonkykong. All rights reserved.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
class ExampleTests: XCTestCase {
|
||||
|
||||
private let styleTitles = ["Slide In", "Slide Out", "In + Out", "Dissolve"]
|
||||
private let swipeHere = "Swipe Here"
|
||||
|
||||
private let app = XCUIApplication()
|
||||
private var mainViewController: XCUIElement {
|
||||
return app.navigationBars[swipeHere]
|
||||
}
|
||||
private var mainViewControllerNavigation: XCUIElement {
|
||||
return mainViewController.otherElements[swipeHere]
|
||||
}
|
||||
|
||||
override func setUp() {
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
|
||||
// In UI tests it is usually best to stop immediately when a failure occurs.
|
||||
continueAfterFailure = false
|
||||
|
||||
// UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
|
||||
XCUIApplication().launch()
|
||||
|
||||
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
func testTapLeft() {
|
||||
let elementsQuery = app.scrollViews.otherElements
|
||||
for title in styleTitles {
|
||||
elementsQuery.buttons[title].tap()
|
||||
mainViewController.buttons["Left Menu"].tap()
|
||||
app.tables/*@START_MENU_TOKEN@*/.staticTexts["Push View Controller 1"]/*[[".cells.staticTexts[\"Push View Controller 1\"]",".staticTexts[\"Push View Controller 1\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.tap()
|
||||
app.navigationBars["You Can Still Swipe!"].buttons[swipeHere].tap()
|
||||
validate()
|
||||
}
|
||||
}
|
||||
|
||||
func testTapRight() {
|
||||
let elementsQuery = app.scrollViews.otherElements
|
||||
for title in styleTitles {
|
||||
elementsQuery.buttons[title].tap()
|
||||
mainViewController.buttons["Right Menu"].tap()
|
||||
app.tables/*@START_MENU_TOKEN@*/.staticTexts["Present View Controller 1"]/*[[".cells.staticTexts[\"Present View Controller 1\"]",".staticTexts[\"Present View Controller 1\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.tap()
|
||||
app.buttons["Dismiss"].tap()
|
||||
validate()
|
||||
}
|
||||
}
|
||||
|
||||
func testSwiping() {
|
||||
mainViewControllerNavigation.swipeRight()
|
||||
let element = app.children(matching: .window).element(boundBy: 0).children(matching: .other).element
|
||||
element.swipeLeft()
|
||||
validate()
|
||||
|
||||
element.swipeLeft()
|
||||
mainViewControllerNavigation.swipeLeft()
|
||||
element.swipeRight()
|
||||
validate()
|
||||
}
|
||||
|
||||
private func validate() {
|
||||
XCTAssertTrue(mainViewController.exists)
|
||||
}
|
||||
|
||||
/* TODO - More tests:
|
||||
- Rotation
|
||||
- All menu settings
|
||||
*/
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
@@ -16,8 +16,6 @@
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
import UIKit
|
||||
import XCTest
|
||||
import SideMenu
|
||||
|
||||
class Tests: XCTestCase {
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
super.tearDown()
|
||||
}
|
||||
|
||||
func testExample() {
|
||||
// This is an example of a functional test case.
|
||||
XCTAssert(true, "Pass")
|
||||
}
|
||||
|
||||
func testPerformanceExample() {
|
||||
// This is an example of a performance test case.
|
||||
self.measure() {
|
||||
// Put the code you want to measure the time of here.
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,7 +27,7 @@ extension SideMenuManager {
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
public var menuPushStyle: MenuPushStyle {
|
||||
public var menuPushStyle: SideMenuPushStyle {
|
||||
get { return .default }
|
||||
set {}
|
||||
}
|
||||
@@ -62,37 +62,37 @@ extension SideMenuManager {
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuPresentationStyle class.")
|
||||
public var menuAnimationFadeStrength: CGFloat {
|
||||
get { return 0 }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuPresentationStyle class.")
|
||||
public var menuAnimationTransformScaleFactor: CGFloat {
|
||||
get { return 1 }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuPresentationStyle class.")
|
||||
public var menuAnimationBackgroundColor: UIColor? {
|
||||
get { return nil }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuPresentationStyle class.")
|
||||
public var menuShadowOpacity: Float {
|
||||
get { return 0.5 }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuPresentationStyle class.")
|
||||
public var menuShadowColor: UIColor {
|
||||
get { return .black }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuPresentationStyle class.")
|
||||
public var menuShadowRadius: CGFloat {
|
||||
get { return 5 }
|
||||
set {}
|
||||
@@ -104,7 +104,7 @@ extension SideMenuManager {
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "This property has been moved to the UISideMenuNavigationController class.")
|
||||
@available(*, deprecated, message: "This property has been moved to the SideMenuPresentationStyle class.")
|
||||
public var menuParallaxStrength: Int {
|
||||
get { return 0 }
|
||||
set {}
|
||||
@@ -182,7 +182,13 @@ extension SideMenuManager {
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, renamed: "SideMenuPresentStyle")
|
||||
@available(*, deprecated, renamed: "enableSwipeToDismissGesture")
|
||||
public var enableSwipeGestures: Bool {
|
||||
get { return true }
|
||||
set {}
|
||||
}
|
||||
|
||||
@available(*, deprecated, renamed: "SideMenuPresentationStyle")
|
||||
public typealias MenuPresentMode = SideMenuPresentationStyle
|
||||
|
||||
@available(*, deprecated, renamed: "addScreenEdgePanGesturesToPresent")
|
||||
@@ -46,12 +46,25 @@ internal extension UIViewController {
|
||||
}
|
||||
}
|
||||
|
||||
// Indicates if the menu is anywhere in the view hierarchy, even if covered by another view controller.
|
||||
@objc var isHidden: Bool {
|
||||
return presentingViewController == nil
|
||||
}
|
||||
}
|
||||
|
||||
internal extension UIGestureRecognizer {
|
||||
|
||||
convenience init(addTo view: UIView, target: Any, action: Selector) {
|
||||
self.init()
|
||||
addTarget(target, action: action)
|
||||
view.addGestureRecognizer(self)
|
||||
}
|
||||
|
||||
convenience init?(addTo view: UIView?, target: Any, action: Selector) {
|
||||
guard let view = view else { return nil }
|
||||
self.init(addTo: view, target: target, action: action)
|
||||
}
|
||||
}
|
||||
|
||||
internal extension UIPanGestureRecognizer {
|
||||
|
||||
var canSwitch: Bool {
|
||||
|
||||
@@ -7,10 +7,11 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
internal protocol InitializableClass: class {
|
||||
public protocol InitializableClass: class {
|
||||
init()
|
||||
}
|
||||
extension InitializableClass {
|
||||
|
||||
public extension InitializableClass {
|
||||
|
||||
init(_ block: (Self) -> Void) {
|
||||
self.init()
|
||||
@@ -23,10 +24,11 @@ extension InitializableClass {
|
||||
}
|
||||
}
|
||||
|
||||
internal protocol InitializableStruct {
|
||||
public protocol InitializableStruct {
|
||||
init()
|
||||
}
|
||||
internal extension InitializableStruct {
|
||||
|
||||
public extension InitializableStruct {
|
||||
init(_ block: (inout Self) -> Void) {
|
||||
self.init()
|
||||
block(&self)
|
||||
|
||||
@@ -28,8 +28,10 @@ internal protocol MenuModel: TransitionModel {
|
||||
var dismissOnRotation: Bool { get }
|
||||
/// Automatically dismisses the menu when app goes to the background.
|
||||
var dismissWhenBackgrounded: Bool { get }
|
||||
/// Enable or disable gestures that would swipe to dismiss the menu. Default is true.
|
||||
var enableSwipeGestures: Bool { get }
|
||||
/// Enable or disable a swipe gesture that dismisses the menu. Will not be triggered when `presentingViewControllerUserInteractionEnabled` is set to true. Default is true.
|
||||
var enableSwipeToDismissGesture: Bool { get }
|
||||
/// Enable or disable a tap gesture that dismisses the menu. Will not be triggered when `presentingViewControllerUserInteractionEnabled` is set to true. Default is true.
|
||||
var enableTapToDismissGesture: Bool { get }
|
||||
/**
|
||||
The push style of the menu.
|
||||
|
||||
|
||||
+13
-5
@@ -13,22 +13,30 @@ internal enum Print: String { case
|
||||
menuAlreadyAssigned = "%@ was already assigned to the %@ of %@. When using multiple SideMenuManagers you may want to use new instances of UISideMenuNavigationController instead of existing instances to avoid crashes if the menu is presented more than once.",
|
||||
menuInUse = "%@ cannot be modified while it's presented.",
|
||||
panGestureAdded = "%@ was called before %@ or %@ was set. Gestures will not work without a menu.",
|
||||
property = "a menu's %@ property can only be changed when it is hidden.",
|
||||
property = "A menu's %@ property can only be changed when it is hidden.",
|
||||
screenGestureAdded = "%@ was called before %@ was set. The gesture will not work without a menu. Use %@ to add gestures for only one menu.",
|
||||
transitioningDelegate = "SideMenu requires use of the transitioningDelegate. It cannot be modified."
|
||||
|
||||
internal static func warning(_ print: Print, arguments: CVarArg..., required: Bool = false) {
|
||||
warning(String(format: print.rawValue, arguments), required: required)
|
||||
enum PropertyName: String { case
|
||||
leftSide
|
||||
}
|
||||
|
||||
internal static func warning(_ print: Print, required: Bool = false) {
|
||||
static func warning(_ print: Print, arguments: CVarArg..., required: Bool = false) {
|
||||
warning(String(format: print.rawValue, arguments: arguments), required: required)
|
||||
}
|
||||
|
||||
static func warning(_ print: Print, arguments: PropertyName..., required: Bool = false) {
|
||||
warning(String(format: print.rawValue, arguments: arguments.map { $0.rawValue }), required: required)
|
||||
}
|
||||
|
||||
static func warning(_ print: Print, required: Bool = false) {
|
||||
warning(print.rawValue, required: required)
|
||||
}
|
||||
}
|
||||
|
||||
private extension Print {
|
||||
|
||||
private static func warning(_ message: String, required: Bool = false) {
|
||||
static func warning(_ message: String, required: Bool = false) {
|
||||
let message = "SideMenu Warning: \(message)"
|
||||
|
||||
if required {
|
||||
|
||||
@@ -9,32 +9,18 @@ import Foundation
|
||||
|
||||
internal final class Protected<T: Equatable> {
|
||||
|
||||
typealias ConditionBlock = (T) -> Bool
|
||||
typealias Block = (T) -> Void
|
||||
typealias ConditionBlock = (_ oldValue: T, T) -> T
|
||||
|
||||
private var _value: T
|
||||
private var conditionBlock: ConditionBlock
|
||||
private var thenBlock: Block?
|
||||
private var elseBlock: Block?
|
||||
private var condition: ConditionBlock
|
||||
|
||||
public var value: T {
|
||||
get {
|
||||
return _value
|
||||
}
|
||||
set {
|
||||
guard conditionBlock(_value) else {
|
||||
elseBlock?(_value)
|
||||
return
|
||||
}
|
||||
_value = newValue
|
||||
thenBlock?(_value)
|
||||
}
|
||||
get { return _value }
|
||||
set { _value = condition(_value, newValue) }
|
||||
}
|
||||
|
||||
init(_ value: T, if conditionBlock: @escaping ConditionBlock, then thenBlock: Block? = nil, else elseBlock: Block? = nil) {
|
||||
init(_ value: T, when condition: @escaping ConditionBlock) {
|
||||
self._value = value
|
||||
self.conditionBlock = conditionBlock
|
||||
self.thenBlock = thenBlock
|
||||
self.elseBlock = elseBlock
|
||||
self.condition = condition
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,21 +30,14 @@ public class SideMenuManager: NSObject {
|
||||
|
||||
var name: String {
|
||||
switch self {
|
||||
case .left: return "menuLeftNavigationController"
|
||||
case .right: return "menuRightNavigationController"
|
||||
case .left: return "leftMenuNavigationController"
|
||||
case .right: return "rightMenuNavigationController"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var _leftMenu: Protected<Menu?> =
|
||||
Protected(nil,
|
||||
if: { $0?.isHidden != false },
|
||||
else: { _ in Print.warning(.menuInUse, arguments: PresentDirection.left.name, required: true) } )
|
||||
|
||||
private var _rightMenu: Protected<Menu?> =
|
||||
Protected(nil,
|
||||
if: { $0?.isHidden != false },
|
||||
else: { _ in Print.warning(.menuInUse, arguments: PresentDirection.right.name, required: true) } )
|
||||
private var _leftMenu: Protected<Menu?> = Protected(nil) { SideMenuManager.setMenu(fromMenu: $0, toMenu: $1) }
|
||||
private var _rightMenu: Protected<Menu?> = Protected(nil) { SideMenuManager.setMenu(fromMenu: $0, toMenu: $1) }
|
||||
|
||||
private var switching: Bool = false
|
||||
|
||||
@@ -58,13 +51,23 @@ public class SideMenuManager: NSObject {
|
||||
|
||||
/// The left menu.
|
||||
open var leftMenuNavigationController: UISideMenuNavigationController? {
|
||||
get { return _leftMenu.value }
|
||||
get {
|
||||
if _leftMenu.value?.isHidden == true {
|
||||
_leftMenu.value?.leftSide = true
|
||||
}
|
||||
return _leftMenu.value
|
||||
}
|
||||
set(menu) { _leftMenu.value = menu }
|
||||
}
|
||||
|
||||
/// The right menu.
|
||||
open var rightMenuNavigationController: UISideMenuNavigationController? {
|
||||
get { return _rightMenu.value }
|
||||
get {
|
||||
if _rightMenu.value?.isHidden == true {
|
||||
_rightMenu.value?.leftSide = false
|
||||
}
|
||||
return _rightMenu.value
|
||||
}
|
||||
set(menu) { _rightMenu.value = menu }
|
||||
}
|
||||
|
||||
@@ -123,6 +126,14 @@ internal extension SideMenuManager {
|
||||
case false: rightMenuNavigationController = menu
|
||||
}
|
||||
}
|
||||
|
||||
private class func setMenu(fromMenu: Menu?, toMenu: Menu?) -> Menu? {
|
||||
if fromMenu?.isHidden == false {
|
||||
Print.warning(.menuInUse, arguments: PresentDirection.left.name, required: true)
|
||||
return fromMenu
|
||||
}
|
||||
return toMenu
|
||||
}
|
||||
}
|
||||
|
||||
private extension SideMenuManager {
|
||||
@@ -193,10 +204,8 @@ private extension SideMenuManager {
|
||||
screenEdgeGestureRecognizer.edges == edge {
|
||||
view.removeGestureRecognizer(screenEdgeGestureRecognizer)
|
||||
}
|
||||
return SideMenuScreenEdgeGestureRecognizer {
|
||||
return SideMenuScreenEdgeGestureRecognizer(addTo: view, target: self, action: #selector(handlePresentMenuScreenEdge(_:))).with {
|
||||
$0.edges = edge
|
||||
$0.addTarget(self, action: #selector(handlePresentMenuScreenEdge(_:)))
|
||||
view.addGestureRecognizer($0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,13 +213,10 @@ private extension SideMenuManager {
|
||||
if let panGestureRecognizer = view.gestureRecognizers?.first(where: { $0 is SideMenuPanGestureRecognizer }) as? SideMenuPanGestureRecognizer {
|
||||
return panGestureRecognizer
|
||||
}
|
||||
return SideMenuPanGestureRecognizer {
|
||||
$0.addTarget(self, action: #selector(handlePresentMenuPan(_:)))
|
||||
view.addGestureRecognizer($0)
|
||||
}
|
||||
return SideMenuPanGestureRecognizer(addTo: view, target: self, action: #selector(handlePresentMenuPan(_:)))
|
||||
}
|
||||
|
||||
private var activeViewController: UIViewController? {
|
||||
var activeViewController: UIViewController? {
|
||||
return UIApplication.shared.keyWindow?.rootViewController?.activeViewController
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,11 +211,9 @@ private extension SideMenuPresentationController {
|
||||
if config.presentationStyle.menuOnTop {
|
||||
addShadow(to: presentedViewController.view)
|
||||
presentedViewController.view.layer.zPosition = 1
|
||||
presentingViewController.view.layer.zPosition = 0
|
||||
} else {
|
||||
addShadow(to: presentingViewController.view)
|
||||
presentingViewController.view.layer.zPosition = 1
|
||||
presentedViewController.view.layer.zPosition = 0
|
||||
presentedViewController.view.layer.zPosition = -1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import Foundation
|
||||
|
||||
@objcMembers
|
||||
public class SideMenuPresentationStyle {
|
||||
open class SideMenuPresentationStyle: InitializableClass {
|
||||
/// Background color behind the views and status bar color
|
||||
public var backgroundColor: UIColor = .black
|
||||
/// The starting alpha value of the menu before it appears
|
||||
@@ -36,12 +36,7 @@ public class SideMenuPresentationStyle {
|
||||
/// The strength of the parallax effect on the presenting view once the menu is displayed.
|
||||
public var presentingParallaxStrength: CGSize = .zero
|
||||
|
||||
public init() {}
|
||||
|
||||
public convenience init(_ block: (SideMenuPresentationStyle) -> Void) {
|
||||
self.init()
|
||||
block(self)
|
||||
}
|
||||
required public init() {}
|
||||
|
||||
/// This method is called just before the presentation transition begins. Use this to setup any animations. The super method does not need to be called.
|
||||
func presentationTransitionWillBegin(to presentedViewController: UIViewController, from presentingViewController: UIViewController) {}
|
||||
|
||||
@@ -27,7 +27,7 @@ internal protocol UISideMenuNavigationControllerTransitionDelegate: class {
|
||||
func sideMenuTransitionDidDismiss(menu: Menu)
|
||||
}
|
||||
|
||||
public struct SideMenuSettings: MenuModel {
|
||||
public struct SideMenuSettings: MenuModel, InitializableStruct {
|
||||
public var allowPushOfSameClassTwice: Bool = true
|
||||
public var alwaysAnimate: Bool = true
|
||||
public var animationOptions: UIView.AnimationOptions = .curveEaseInOut
|
||||
@@ -39,7 +39,8 @@ public struct SideMenuSettings: MenuModel {
|
||||
public var dismissOnPush: Bool = true
|
||||
public var dismissOnRotation: Bool = true
|
||||
public var dismissWhenBackgrounded: Bool = true
|
||||
public var enableSwipeGestures: Bool = true
|
||||
public var enableSwipeToDismissGesture: Bool = true
|
||||
public var enableTapToDismissGesture: Bool = true
|
||||
public var initialSpringVelocity: CGFloat = 1
|
||||
public var menuWidth: CGFloat = {
|
||||
let appScreenRect = UIApplication.shared.keyWindow?.bounds ?? UIWindow().bounds
|
||||
@@ -55,11 +56,6 @@ public struct SideMenuSettings: MenuModel {
|
||||
public var usingSpringWithDamping: CGFloat = 1
|
||||
|
||||
public init() {}
|
||||
|
||||
public init(_ block: (inout SideMenuSettings) -> Void) {
|
||||
self.init()
|
||||
block(&self)
|
||||
}
|
||||
}
|
||||
|
||||
internal typealias Menu = UISideMenuNavigationController
|
||||
@@ -67,16 +63,16 @@ internal typealias Menu = UISideMenuNavigationController
|
||||
@objcMembers
|
||||
open class UISideMenuNavigationController: UINavigationController {
|
||||
|
||||
private enum PropertyName: String { case
|
||||
leftSide
|
||||
private lazy var _leftSide = Protected(false) { [weak self] oldValue, newValue in
|
||||
guard self?.isHidden != false else {
|
||||
Print.warning(.property, arguments: .leftSide, required: true)
|
||||
return oldValue
|
||||
}
|
||||
return newValue
|
||||
}
|
||||
|
||||
private lazy var _leftSide = Protected(false,
|
||||
if: { [weak self] _ in self?.isHidden != false },
|
||||
else: { _ in Menu.elseCondition(.leftSide) } )
|
||||
|
||||
private weak var _sideMenuManager: SideMenuManager?
|
||||
private weak var foundDelegate: UISideMenuNavigationControllerDelegate?
|
||||
private weak var foundViewController: UIViewController?
|
||||
private weak var interactionController: SideMenuInteractionController?
|
||||
private var interactive: Bool = false
|
||||
private var originalBackgroundColor: UIColor?
|
||||
@@ -87,7 +83,9 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
internal weak var sideMenuDelegate: UISideMenuNavigationControllerDelegate?
|
||||
|
||||
/// The swipe to dismiss gesture.
|
||||
private(set) weak var swipeToDismissGesture: UIPanGestureRecognizer? = nil
|
||||
open private(set) weak var swipeToDismissGesture: UIPanGestureRecognizer? = nil
|
||||
/// The tap to dismiss gesture.
|
||||
open private(set) weak var tapToDismissGesture: UITapGestureRecognizer? = nil
|
||||
|
||||
open var sideMenuManager: SideMenuManager {
|
||||
get { return _sideMenuManager ?? SideMenuManager.default }
|
||||
@@ -106,22 +104,24 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
open var settings = SideMenuSettings() {
|
||||
didSet {
|
||||
setupBlur()
|
||||
setupSwipeGestures()
|
||||
if !enableSwipeToDismissGesture {
|
||||
removeSwipeGesture()
|
||||
}
|
||||
if !enableTapToDismissGesture {
|
||||
removeTapGesture()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
|
||||
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
|
||||
}
|
||||
|
||||
public convenience init(_ block: (UISideMenuNavigationController) -> Void) {
|
||||
self.init()
|
||||
block(self)
|
||||
setup()
|
||||
}
|
||||
|
||||
public init(rootViewController: UIViewController, settings: SideMenuSettings = SideMenuSettings()) {
|
||||
super.init(rootViewController: rootViewController)
|
||||
self.settings = settings
|
||||
setup()
|
||||
}
|
||||
|
||||
required public init?(coder aDecoder: NSCoder) {
|
||||
@@ -144,7 +144,7 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
// Dismiss keyboard to prevent weird keyboard animations from occurring during transition
|
||||
presentingViewController?.view.endEditing(true)
|
||||
|
||||
foundDelegate = nil
|
||||
foundViewController = nil
|
||||
activeDelegate?.sideMenuWillAppear?(menu: self, animated: animated)
|
||||
}
|
||||
|
||||
@@ -165,24 +165,28 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
override open func viewWillDisappear(_ animated: Bool) {
|
||||
super.viewWillDisappear(animated)
|
||||
|
||||
defer {
|
||||
activeDelegate?.sideMenuWillDisappear?(menu: self, animated: animated)
|
||||
}
|
||||
|
||||
guard !isBeingDismissed else { return }
|
||||
|
||||
// When presenting a view controller from the menu, the menu view gets moved into another transition view above our transition container
|
||||
// which can break the visual layout we had before. So, we move the menu view back to its original transition view to preserve it.
|
||||
if dismissOnPresent && !isBeingDismissed {
|
||||
// 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 let presentingView = presentingViewController?.view, let containerView = presentingView.superview {
|
||||
containerView.addSubview(view)
|
||||
}
|
||||
if let presentingView = presentingViewController?.view, let containerView = presentingView.superview {
|
||||
containerView.addSubview(view)
|
||||
}
|
||||
|
||||
if dismissOnPresent {
|
||||
// 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.
|
||||
transitionController?.transition(presenting: false, animated: animated, alongsideTransition: { [weak self] in
|
||||
guard let self = self else { return }
|
||||
self.activeDelegate?.sideMenuWillDisappear?(menu: self, animated: animated)
|
||||
}, complete: false, completion: { [weak self] _ in
|
||||
guard let self = self else { return }
|
||||
self.activeDelegate?.sideMenuDidDisappear?(menu: self, animated: animated)
|
||||
self.view.isHidden = true
|
||||
}, complete: false, completion: { [weak self] _ in
|
||||
guard let self = self else { return }
|
||||
self.activeDelegate?.sideMenuDidDisappear?(menu: self, animated: animated)
|
||||
self.view.isHidden = true
|
||||
})
|
||||
} else {
|
||||
activeDelegate?.sideMenuWillDisappear?(menu: self, animated: animated)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,7 +197,7 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
// the view hierarchy leaving the screen black/empty. This is because the transition moves views within a container
|
||||
// view, but dismissing without animation removes the container view before the original hierarchy is restored.
|
||||
// This check corrects that.
|
||||
if presentedViewController == nil && view.window == nil {
|
||||
if let foundViewController = self.visibleViewController(from: presentingViewController), foundViewController.view.window == nil {
|
||||
transitionController?.transition(presenting: false, animated: false)
|
||||
}
|
||||
|
||||
@@ -207,10 +211,10 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
|
||||
activeDelegate?.sideMenuDidDisappear?(menu: self, animated: animated)
|
||||
|
||||
if dismissOnPresent && !isBeingDismissed {
|
||||
view.isHidden = true
|
||||
} else {
|
||||
if isBeingDismissed {
|
||||
transitionController = nil
|
||||
} else if dismissOnPresent {
|
||||
view.isHidden = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,15 +241,84 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
self.rotating = false
|
||||
}
|
||||
}
|
||||
|
||||
open override func viewWillLayoutSubviews() {
|
||||
super.viewWillLayoutSubviews()
|
||||
transitionController?.layout()
|
||||
}
|
||||
|
||||
override open func pushViewController(_ viewController: UIViewController, animated: Bool) {
|
||||
let push = shouldPushViewController(viewController: viewController, animated: animated) { [weak self] _ in
|
||||
self?.foundDelegate = nil
|
||||
guard viewControllers.count > 0 && pushStyle != .subMenu else {
|
||||
// NOTE: pushViewController is called by init(rootViewController: UIViewController)
|
||||
// so we must perform the normal super method in this case
|
||||
return super.pushViewController(viewController, animated: animated)
|
||||
}
|
||||
|
||||
if push {
|
||||
super.pushViewController(viewController, animated: animated)
|
||||
|
||||
let splitViewController = presentingViewController as? UISplitViewController
|
||||
let tabBarController = presentingViewController as? UITabBarController
|
||||
let potentialNavigationController = (splitViewController?.viewControllers.first ?? tabBarController?.selectedViewController) ?? presentingViewController
|
||||
guard let navigationController = potentialNavigationController as? UINavigationController else {
|
||||
return Print.warning(.cannotPush, arguments: String(describing: potentialNavigationController.self), required: true)
|
||||
}
|
||||
|
||||
// To avoid overlapping dismiss & pop/push calls, create a transaction block where the menu
|
||||
// is dismissed after showing the appropriate screen
|
||||
CATransaction.begin()
|
||||
defer { CATransaction.commit() }
|
||||
|
||||
if dismissOnPush {
|
||||
let animated = animated || alwaysAnimate
|
||||
if animated {
|
||||
let areAnimationsEnabled = UIView.areAnimationsEnabled
|
||||
UIView.setAnimationsEnabled(true)
|
||||
transitionController?.transition(presenting: false, animated: animated, alongsideTransition: { [weak self] in
|
||||
guard let self = self else { return }
|
||||
self.activeDelegate?.sideMenuWillDisappear?(menu: self, animated: animated)
|
||||
}, completion: { [weak self] _ in
|
||||
guard let self = self else { return }
|
||||
self.activeDelegate?.sideMenuDidDisappear?(menu: self, animated: animated)
|
||||
self.dismiss(animated: false, completion: nil)
|
||||
self.foundViewController = nil
|
||||
})
|
||||
UIView.setAnimationsEnabled(areAnimationsEnabled)
|
||||
}
|
||||
}
|
||||
|
||||
if let lastViewController = navigationController.viewControllers.last,
|
||||
!allowPushOfSameClassTwice && type(of: lastViewController) == type(of: viewController) {
|
||||
return
|
||||
}
|
||||
|
||||
switch pushStyle {
|
||||
case .subMenu: return // handled earlier
|
||||
case .default: break
|
||||
case .popWhenPossible:
|
||||
for subViewController in navigationController.viewControllers.reversed() {
|
||||
if type(of: subViewController) == type(of: viewController) {
|
||||
navigationController.popToViewController(subViewController, animated: animated)
|
||||
return
|
||||
}
|
||||
}
|
||||
case .preserve, .preserveAndHideBackButton:
|
||||
var viewControllers = navigationController.viewControllers
|
||||
let filtered = viewControllers.filter { preservedViewController in type(of: preservedViewController) == type(of: viewController) }
|
||||
if let preservedViewController = filtered.last {
|
||||
viewControllers = viewControllers.filter { subViewController in subViewController !== preservedViewController }
|
||||
if pushStyle == .preserveAndHideBackButton {
|
||||
preservedViewController.navigationItem.hidesBackButton = true
|
||||
}
|
||||
viewControllers.append(preservedViewController)
|
||||
return navigationController.setViewControllers(viewControllers, animated: animated)
|
||||
}
|
||||
if pushStyle == .preserveAndHideBackButton {
|
||||
viewController.navigationItem.hidesBackButton = true
|
||||
}
|
||||
case .replace:
|
||||
viewController.navigationItem.hidesBackButton = true
|
||||
return navigationController.setViewControllers([viewController], animated: animated)
|
||||
}
|
||||
|
||||
navigationController.pushViewController(viewController, animated: animated)
|
||||
}
|
||||
|
||||
override open var transitioningDelegate: UIViewControllerTransitioningDelegate? {
|
||||
@@ -312,9 +385,14 @@ extension UISideMenuNavigationController: MenuModel {
|
||||
set { settings.dismissWhenBackgrounded = newValue }
|
||||
}
|
||||
|
||||
@IBInspectable open var enableSwipeGestures: Bool {
|
||||
get { return settings.enableSwipeGestures }
|
||||
set { settings.enableSwipeGestures = newValue }
|
||||
@IBInspectable open var enableSwipeToDismissGesture: Bool {
|
||||
get { return settings.enableSwipeToDismissGesture }
|
||||
set { settings.enableSwipeToDismissGesture = newValue }
|
||||
}
|
||||
|
||||
@IBInspectable open var enableTapToDismissGesture: Bool {
|
||||
get { return settings.enableTapToDismissGesture }
|
||||
set { settings.enableTapToDismissGesture = newValue }
|
||||
}
|
||||
|
||||
@IBInspectable open var initialSpringVelocity: CGFloat {
|
||||
@@ -327,6 +405,11 @@ extension UISideMenuNavigationController: MenuModel {
|
||||
get { return _leftSide.value }
|
||||
set { _leftSide.value = newValue }
|
||||
}
|
||||
|
||||
/// Indicates if the menu is anywhere in the view hierarchy, even if covered by another view controller.
|
||||
open override var isHidden: Bool {
|
||||
return super.isHidden
|
||||
}
|
||||
|
||||
@IBInspectable open var menuWidth: CGFloat {
|
||||
get { return settings.menuWidth }
|
||||
@@ -392,8 +475,9 @@ extension UISideMenuNavigationController: UIViewControllerTransitioningDelegate
|
||||
return interactionController(using: animator)
|
||||
}
|
||||
|
||||
open func interactionController(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? {
|
||||
private func interactionController(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? {
|
||||
guard interactive else { return nil }
|
||||
interactive = false
|
||||
let interactionController = SideMenuInteractionController(cancelWhenBackgrounded: dismissWhenBackgrounded, completionCurve: completionCurve)
|
||||
self.interactionController = interactionController
|
||||
return interactionController
|
||||
@@ -407,17 +491,9 @@ extension UISideMenuNavigationController: SideMenuTransitionControllerDelegate {
|
||||
}
|
||||
|
||||
internal func sideMenuTransitionController(_ transitionController: SideMenuTransitionController, didPresent viewController: UIViewController) {
|
||||
guard !presentingViewControllerUserInteractionEnabled else { return }
|
||||
|
||||
let panGesture = UIPanGestureRecognizer()
|
||||
panGesture.cancelsTouchesInView = false
|
||||
panGesture.addTarget(self, action: #selector(handleDismissMenuPan(_:)))
|
||||
view.superview?.addGestureRecognizer(panGesture)
|
||||
|
||||
let tapGestureRecognizer = UITapGestureRecognizer()
|
||||
tapGestureRecognizer.addTarget(self, action: #selector(handleDismissMenuTap(_:)))
|
||||
tapGestureRecognizer.cancelsTouchesInView = false
|
||||
view.superview?.addGestureRecognizer(tapGestureRecognizer)
|
||||
removeSwipeGesture()
|
||||
swipeToDismissGesture = addSwipeToDismissGesture(to: view.superview)
|
||||
tapToDismissGesture = addTapToDismissGesture(to: view.superview)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -464,118 +540,36 @@ internal extension UISideMenuNavigationController {
|
||||
|
||||
private extension UISideMenuNavigationController {
|
||||
|
||||
func shouldPushViewController(viewController: UIViewController, animated: Bool, completion: ((Bool) -> Void)?) -> Bool {
|
||||
guard viewControllers.count > 0 && pushStyle != .subMenu else {
|
||||
// NOTE: pushViewController is called by init(rootViewController: UIViewController)
|
||||
// so we must perform the normal super method in this case
|
||||
return true
|
||||
}
|
||||
|
||||
let splitViewController = presentingViewController as? UISplitViewController
|
||||
let tabBarController = presentingViewController as? UITabBarController
|
||||
let potentialNavigationController = (splitViewController?.viewControllers.first ?? tabBarController?.selectedViewController) ?? presentingViewController
|
||||
guard let navigationController = potentialNavigationController as? UINavigationController else {
|
||||
Print.warning(.cannotPush, arguments: String(describing: potentialNavigationController.self), required: true)
|
||||
return false
|
||||
}
|
||||
|
||||
// To avoid overlapping dismiss & pop/push calls, create a transaction block where the menu
|
||||
// is dismissed after showing the appropriate screen
|
||||
CATransaction.begin()
|
||||
defer { CATransaction.commit() }
|
||||
var push = false
|
||||
|
||||
if dismissOnPush {
|
||||
let animated = animated || alwaysAnimate
|
||||
if animated {
|
||||
let areAnimationsEnabled = UIView.areAnimationsEnabled
|
||||
UIView.setAnimationsEnabled(true)
|
||||
transitionController?.transition(presenting: false, animated: animated, alongsideTransition: { [weak self] in
|
||||
guard let self = self else { return }
|
||||
self.activeDelegate?.sideMenuWillDisappear?(menu: self, animated: animated)
|
||||
}, completion: { [weak self] _ in
|
||||
guard let self = self else { return }
|
||||
self.activeDelegate?.sideMenuDidDisappear?(menu: self, animated: animated)
|
||||
self.dismiss(animated: false, completion: nil)
|
||||
completion?(push)
|
||||
})
|
||||
UIView.setAnimationsEnabled(areAnimationsEnabled)
|
||||
}
|
||||
}
|
||||
|
||||
if let lastViewController = navigationController.viewControllers.last,
|
||||
!allowPushOfSameClassTwice && type(of: lastViewController) == type(of: viewController) {
|
||||
return false
|
||||
}
|
||||
|
||||
switch pushStyle {
|
||||
case .subMenu: return false // handled earlier
|
||||
case .default:
|
||||
navigationController.pushViewController(viewController, animated: animated)
|
||||
return false
|
||||
case .popWhenPossible:
|
||||
for subViewController in navigationController.viewControllers.reversed() {
|
||||
if type(of: subViewController) == type(of: viewController) {
|
||||
navigationController.popToViewController(subViewController, animated: animated)
|
||||
return false
|
||||
}
|
||||
}
|
||||
push = true
|
||||
return true
|
||||
case .preserve, .preserveAndHideBackButton:
|
||||
var viewControllers = navigationController.viewControllers
|
||||
let filtered = viewControllers.filter { preservedViewController in type(of: preservedViewController) == type(of: viewController) }
|
||||
if let preservedViewController = filtered.last {
|
||||
viewControllers = viewControllers.filter { subViewController in subViewController !== preservedViewController }
|
||||
if pushStyle == .preserveAndHideBackButton {
|
||||
preservedViewController.navigationItem.hidesBackButton = true
|
||||
}
|
||||
viewControllers.append(preservedViewController)
|
||||
navigationController.setViewControllers(viewControllers, animated: animated)
|
||||
return false
|
||||
}
|
||||
if pushStyle == .preserveAndHideBackButton {
|
||||
viewController.navigationItem.hidesBackButton = true
|
||||
}
|
||||
|
||||
push = true
|
||||
return true
|
||||
case .replace:
|
||||
viewController.navigationItem.hidesBackButton = true
|
||||
navigationController.setViewControllers([viewController], animated: animated)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
private class func elseCondition(_ propertyName: PropertyName) {
|
||||
Print.warning(.property, arguments: propertyName.rawValue, required: true)
|
||||
}
|
||||
|
||||
weak var activeDelegate: UISideMenuNavigationControllerDelegate? {
|
||||
guard !view.isHidden else { return nil }
|
||||
return sideMenuDelegate ?? foundDelegate ?? findDelegate(forViewController: presentingViewController)
|
||||
if let sideMenuDelegate = sideMenuDelegate {
|
||||
return sideMenuDelegate
|
||||
}
|
||||
return visibleViewController(from: presentingViewController) as? UISideMenuNavigationControllerDelegate
|
||||
}
|
||||
|
||||
func findDelegate(forViewController: UIViewController?) -> UISideMenuNavigationControllerDelegate? {
|
||||
if let navigationController = forViewController as? UINavigationController {
|
||||
return findDelegate(forViewController: navigationController.topViewController)
|
||||
func visibleViewController(from: UIViewController?) -> UIViewController? {
|
||||
if let foundDelegate = foundViewController {
|
||||
return foundDelegate
|
||||
}
|
||||
if let tabBarController = forViewController as? UITabBarController {
|
||||
return findDelegate(forViewController: tabBarController.selectedViewController)
|
||||
if let navigationController = from as? UINavigationController {
|
||||
return visibleViewController(from: navigationController.topViewController)
|
||||
}
|
||||
if let splitViewController = forViewController as? UISplitViewController {
|
||||
return findDelegate(forViewController: splitViewController.viewControllers.last)
|
||||
if let tabBarController = from as? UITabBarController {
|
||||
return visibleViewController(from: tabBarController.selectedViewController)
|
||||
}
|
||||
if let splitViewController = from as? UISplitViewController {
|
||||
return visibleViewController(from: splitViewController.viewControllers.last)
|
||||
}
|
||||
|
||||
foundDelegate = forViewController as? UISideMenuNavigationControllerDelegate
|
||||
return foundDelegate
|
||||
foundViewController = from
|
||||
return from
|
||||
}
|
||||
|
||||
func setup() {
|
||||
modalPresentationStyle = .overFullScreen
|
||||
|
||||
setupBlur()
|
||||
setupSwipeGestures()
|
||||
registerForNotifications()
|
||||
}
|
||||
|
||||
@@ -622,12 +616,15 @@ private extension UISideMenuNavigationController {
|
||||
}
|
||||
}
|
||||
|
||||
func setupSwipeGestures() {
|
||||
func removeSwipeGesture() {
|
||||
if let swipeToDismissGesture = swipeToDismissGesture {
|
||||
swipeToDismissGesture.view?.removeGestureRecognizer(swipeToDismissGesture)
|
||||
}
|
||||
if enableSwipeGestures {
|
||||
swipeToDismissGesture = addDismissPanGesture(to: view)
|
||||
}
|
||||
|
||||
func removeTapGesture() {
|
||||
if let tapToDismissGesture = tapToDismissGesture {
|
||||
tapToDismissGesture.view?.removeGestureRecognizer(tapToDismissGesture)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -657,16 +654,23 @@ private extension UISideMenuNavigationController {
|
||||
}
|
||||
}
|
||||
|
||||
@discardableResult func addDismissPanGesture(to view: UIView) -> UIPanGestureRecognizer {
|
||||
return UIPanGestureRecognizer {
|
||||
@discardableResult func addSwipeToDismissGesture(to view: UIView?) -> UIPanGestureRecognizer? {
|
||||
guard enableSwipeToDismissGesture else { return nil }
|
||||
return UIPanGestureRecognizer(addTo: view, target: self, action: #selector(handleDismissMenuPan(_:)))?.with {
|
||||
$0.cancelsTouchesInView = false
|
||||
}
|
||||
}
|
||||
|
||||
@discardableResult func addTapToDismissGesture(to view: UIView?) -> UITapGestureRecognizer? {
|
||||
guard enableTapToDismissGesture else { return nil }
|
||||
return UITapGestureRecognizer(addTo: view, target: self, action: #selector(handleDismissMenuTap(_:)))?.with {
|
||||
$0.cancelsTouchesInView = false
|
||||
$0.addTarget(self, action: #selector(handleDismissMenuPan(_:)))
|
||||
view.addGestureRecognizer($0)
|
||||
}
|
||||
}
|
||||
|
||||
@objc func handleDismissMenuTap(_ tap: UITapGestureRecognizer) {
|
||||
guard view.window?.hitTest(tap.location(in: nil), with: nil) == view.superview else { return }
|
||||
let hitTest = view.window?.hitTest(tap.location(in: view.superview), with: nil)
|
||||
guard hitTest == view.superview else { return }
|
||||
dismissMenu()
|
||||
}
|
||||
|
||||
|
||||
Generated
+14
@@ -17,6 +17,7 @@
|
||||
5B0A5C9933D0FCD08E12CFFB56145333 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3212113385A8FBBDB272BD23C409FF61 /* Foundation.framework */; };
|
||||
614FC39555CB129D97FC24B2D953A427 /* SideMenuPresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61AFB3209BCB97295281AC6437FB346B /* SideMenuPresentationController.swift */; };
|
||||
6E6E17C0E8351D23CB4B20332C70BE61 /* Print.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CB39D726F07EA27650309A1A3213412 /* Print.swift */; };
|
||||
8428210422E0540800C6F2D8 /* Deprecations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8428210022E0448700C6F2D8 /* Deprecations.swift */; };
|
||||
89B2CFA98A07964FBD2D7775FF5FB98D /* Pods-Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = D6D7C498FA339E02BD53ECB8916CEA8E /* Pods-Example-dummy.m */; };
|
||||
A2ACFE2D997BC8F1DA4EE3064A4270DD /* SideMenuInteractionController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB64592703EA9A196B5C0F07BA1A918A /* SideMenuInteractionController.swift */; };
|
||||
BD5C0C12B6BB0BF6DA294E095B35E38D /* Initializable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00F847D27577EF5335081BFA43A0BFA3 /* Initializable.swift */; };
|
||||
@@ -57,6 +58,7 @@
|
||||
441854E35F81731E63E53DC7E4EEAD9D /* Pods-Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-Example-acknowledgements.markdown"; sourceTree = "<group>"; };
|
||||
61AFB3209BCB97295281AC6437FB346B /* SideMenuPresentationController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SideMenuPresentationController.swift; path = Pod/Classes/SideMenuPresentationController.swift; sourceTree = "<group>"; };
|
||||
7825A90E082A1582EB16256B0E722B3F /* Pods-Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-Example-umbrella.h"; sourceTree = "<group>"; };
|
||||
8428210022E0448700C6F2D8 /* Deprecations.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Deprecations.swift; path = Pod/Classes/Deprecations.swift; sourceTree = "<group>"; };
|
||||
8F8B09C72B577EFDB20A3EFF4F0C668A /* UISideMenuNavigationController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = UISideMenuNavigationController.swift; path = Pod/Classes/UISideMenuNavigationController.swift; sourceTree = "<group>"; };
|
||||
9CF977D7FB42D367F2810037EBA59B7D /* SideMenu-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "SideMenu-dummy.m"; sourceTree = "<group>"; };
|
||||
9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
|
||||
@@ -135,6 +137,7 @@
|
||||
children = (
|
||||
71A499AE33E397EBD7FA1A9D5B8440BA /* Pod */,
|
||||
B5D061624D54AFB703E72CCF860BDB15 /* Support Files */,
|
||||
8428210022E0448700C6F2D8 /* Deprecations.swift */,
|
||||
F1B25193EDCA447F119795F68F75BF05 /* Extensions.swift */,
|
||||
00F847D27577EF5335081BFA43A0BFA3 /* Initializable.swift */,
|
||||
B5F10B146FA49E99D07F0FA0E38ABE8F /* Models.swift */,
|
||||
@@ -276,6 +279,11 @@
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 1100;
|
||||
LastUpgradeCheck = 1100;
|
||||
TargetAttributes = {
|
||||
0AEE99A309977BD12A049FF48AF9BA4B = {
|
||||
LastSwiftMigration = 1020;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
@@ -317,6 +325,7 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8428210422E0540800C6F2D8 /* Deprecations.swift in Sources */,
|
||||
31E79D7BA42208D00E73C18CBAF1598E /* Extensions.swift in Sources */,
|
||||
BD5C0C12B6BB0BF6DA294E095B35E38D /* Initializable.swift in Sources */,
|
||||
0D2D410A6087D4E0A54642165913EF30 /* Models.swift in Sources */,
|
||||
@@ -454,6 +463,7 @@
|
||||
baseConfigurationReference = 243410B9535472556EA4BB6DBC133A0D /* Pods-Example.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = NO;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
|
||||
@@ -477,6 +487,7 @@
|
||||
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
@@ -548,6 +559,7 @@
|
||||
baseConfigurationReference = B45138496B85A072654D1D0F8EBBEDE5 /* Pods-Example.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = NO;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
|
||||
@@ -571,6 +583,8 @@
|
||||
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# ▤ SideMenu
|
||||
[](https://circleci.com/gh/jonkykong/SideMenu)
|
||||
[](http://cocoapods.org/pods/SideMenu)
|
||||
[](https://github.com/Carthage/Carthage)
|
||||
[](http://cocoapods.org/pods/SideMenu)
|
||||
@@ -72,10 +73,10 @@ use_frameworks!
|
||||
pod 'SideMenu'
|
||||
|
||||
# For Swift 5 use:
|
||||
# pod 'SideMenu', '~> 6.0.0'
|
||||
# pod 'SideMenu', '~> 6.0'
|
||||
|
||||
# For Swift 4.2 (no longer maintained) use:
|
||||
# pod 'SideMenu', '~> 5.0.0'
|
||||
# pod 'SideMenu', '~> 5.0'
|
||||
```
|
||||
|
||||
Then, run the following command:
|
||||
@@ -137,11 +138,11 @@ dismiss(animated: true, completion: nil)
|
||||
To use gestures you have to use the `SideMenuManager`. In your `AppDelegate` do something like this:
|
||||
``` swift
|
||||
// Define the menus
|
||||
let menuLeftNavigationController = UISideMenuNavigationController(rootViewController: YourViewController)
|
||||
SideMenuManager.default.menuLeftNavigationController = menuLeftNavigationController
|
||||
let leftMenuNavigationController = UISideMenuNavigationController(rootViewController: YourViewController)
|
||||
SideMenuManager.default.leftMenuNavigationController = leftMenuNavigationController
|
||||
|
||||
let menuRightNavigationController = UISideMenuNavigationController(rootViewController: YourViewController)
|
||||
SideMenuManager.default.menuRightNavigationController = menuRightNavigationController
|
||||
let rightMenuNavigationController = UISideMenuNavigationController(rootViewController: YourViewController)
|
||||
SideMenuManager.default.rightMenuNavigationController = rightMenuNavigationController
|
||||
|
||||
// Setup 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!
|
||||
@@ -149,9 +150,9 @@ SideMenuManager.default.addPanGestureToPresent(toView: self.navigationController
|
||||
SideMenuManager.default.addScreenEdgePanGesturesToPresent(toView: self.navigationController!.view)
|
||||
|
||||
// (Optional) Prevent status bar area from turning black when menu appears:
|
||||
menuLeftNavigationController.statusBarEndAlpha = 0
|
||||
leftMenuNavigationController.statusBarEndAlpha = 0
|
||||
// Copy all settings to the other menu
|
||||
menuRightNavigationController.settings = menuLeftNavigationController.settings
|
||||
rightMenuNavigationController.settings = leftMenuNavigationController.settings
|
||||
```
|
||||
That's it.
|
||||
### Customization
|
||||
@@ -159,9 +160,9 @@ That's it.
|
||||
`SideMenuManager` supports the following:
|
||||
``` swift
|
||||
/// The left menu.
|
||||
open var menuLeftNavigationController: UISideMenuNavigationController?
|
||||
open var leftMenuNavigationController: UISideMenuNavigationController?
|
||||
/// The right menu.
|
||||
public var menuRightNavigationController: UISideMenuNavigationController?
|
||||
public var rightMenuNavigationController: UISideMenuNavigationController?
|
||||
/**
|
||||
Adds screen edge gestures for both left and right sides to a view to present a menu.
|
||||
|
||||
@@ -217,8 +218,10 @@ var dismissOnPush: Bool = true
|
||||
var dismissOnRotation: Bool = true
|
||||
/// Automatically dismisses the menu when app goes to the background.
|
||||
var dismissWhenBackgrounded: Bool = true
|
||||
/// Enable or disable gestures that would swipe to dismiss the menu. Default is true.
|
||||
var enableSwipeGestures: Bool = true
|
||||
/// Enable or disable a swipe gesture that dismisses the menu. Will not be triggered when `presentingViewControllerUserInteractionEnabled` is set to true. Default is true.
|
||||
var enableSwipeToDismissGesture: Bool = true
|
||||
/// Enable or disable a tap gesture that dismisses the menu. Will not be triggered when `presentingViewControllerUserInteractionEnabled` is set to true. Default is true.
|
||||
var enableTapToDismissGesture: Bool = true
|
||||
/// The animation initial spring velocity when a menu is displayed. Ignored when displayed with a gesture.
|
||||
var initialSpringVelocity: CGFloat = 1
|
||||
/// Whether the menu appears on the right or left side of the screen. Right is the default. This property cannot be changed after the menu has loaded.
|
||||
@@ -256,21 +259,21 @@ var isHidden: Bool
|
||||
There are 8 pre-defined `SideMenuPresentStyle` options:
|
||||
``` swift
|
||||
/// Menu slides in over the existing view.
|
||||
static let menuSlideIn = SideMenuPresentStyle
|
||||
static let menuSlideIn: SideMenuPresentStyle
|
||||
/// The existing view slides out to reveal the menu underneath.
|
||||
static let viewSlideOut = SideMenuPresentStyle
|
||||
static let viewSlideOut: SideMenuPresentStyle
|
||||
/// The existing view slides out while the menu slides in.
|
||||
static let viewSlideOutMenuIn = SideMenuPresentStyle
|
||||
static let viewSlideOutMenuIn: SideMenuPresentStyle
|
||||
/// The menu dissolves in over the existing view.
|
||||
static let menuDissolveIn = SideMenuPresentStyle
|
||||
static let menuDissolveIn: SideMenuPresentStyle
|
||||
/// The existing view slides out while the menu partially slides in.
|
||||
static let viewSlideOutMenuPartialIn = SideMenuPresentStyle
|
||||
static let viewSlideOutMenuPartialIn: SideMenuPresentStyle
|
||||
/// The existing view slides out while the menu slides out from under it.
|
||||
static let viewSlideOutMenuOut = SideMenuPresentStyle
|
||||
static let viewSlideOutMenuOut: SideMenuPresentStyle
|
||||
/// The existing view slides out while the menu partially slides out from under it.
|
||||
static let viewSlideOutMenuPartialOut = SideMenuPresentStyle
|
||||
static let viewSlideOutMenuPartialOut: SideMenuPresentStyle
|
||||
/// The existing view slides out and shrinks to reveal the menu underneath.
|
||||
static let viewSlideOutMenuZoom = SideMenuPresentStyle
|
||||
static let viewSlideOutMenuZoom: SideMenuPresentStyle
|
||||
```
|
||||
#### UISideMenuNavigationControllerDelegate
|
||||
To receive notifications when a menu is displayed from a view controller, have it adhere to the `UISideMenuNavigationControllerDelegate` protocol:
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "SideMenu"
|
||||
s.version = "6.0.2"
|
||||
s.version = "6.1.5"
|
||||
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.
|
||||
@@ -29,7 +29,7 @@ Pod::Spec.new do |s|
|
||||
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
|
||||
|
||||
s.ios.deployment_target = '10.0'
|
||||
s.swift_version = '5'
|
||||
s.swift_version = '5.0'
|
||||
|
||||
s.source_files = 'Pod/Classes/**/*'
|
||||
# s.resource_bundles = {
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
842820FB22DDD1E800C6F2D8 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842820F522DDD1E800C6F2D8 /* Extensions.swift */; };
|
||||
842820FD22DDD21100C6F2D8 /* SideMenuPresentationStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842820FC22DDD21100C6F2D8 /* SideMenuPresentationStyle.swift */; };
|
||||
842820FF22DDD24200C6F2D8 /* SideMenuInteractionController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842820FE22DDD24200C6F2D8 /* SideMenuInteractionController.swift */; };
|
||||
8428210322E0449300C6F2D8 /* Deprecations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8428210222E0449300C6F2D8 /* Deprecations.swift */; };
|
||||
8432CC0422FFBCF5003D2BBD /* ExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8432CC0322FFBCF5003D2BBD /* ExampleTests.swift */; };
|
||||
8461A2D51E145A08001DA4F8 /* UISideMenuNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8461A2D11E145A08001DA4F8 /* UISideMenuNavigationController.swift */; };
|
||||
8461A2D61E145A08001DA4F8 /* UITableViewVibrantCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8461A2D21E145A08001DA4F8 /* UITableViewVibrantCell.swift */; };
|
||||
84B489B51DD469B000D6CB43 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 84B489B21DD469B000D6CB43 /* LICENSE */; };
|
||||
@@ -33,6 +35,16 @@
|
||||
ACD6DAED90DE36FEA68CDF38 /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 47896ABC5C8830D88945A8D3 /* Pods_Example.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
8432CC0622FFBCF5003D2BBD /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 7B9DC8FB1DC6E8C1000D4007 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 7B48A0D21DCB2487002990A1;
|
||||
remoteInfo = Example;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
1F17B9D56ADA958C611FAA83 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
281FB58A39C022692CEEBF0D /* Pods-Example-ExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-ExampleTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
@@ -43,8 +55,6 @@
|
||||
7B48A0D51DCB2487002990A1 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
7B48A0DC1DCB2487002990A1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
7B48A0E11DCB2487002990A1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
7B48A0EA1DCB2487002990A1 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = "<group>"; };
|
||||
7B48A0EC1DCB2487002990A1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
7B48A0F31DCB2518002990A1 /* MainViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = "<group>"; };
|
||||
7B48A0F41DCB2518002990A1 /* PresentedViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PresentedViewController.swift; sourceTree = "<group>"; };
|
||||
7B48A0F51DCB2518002990A1 /* SideMenuTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SideMenuTableViewController.swift; sourceTree = "<group>"; };
|
||||
@@ -61,6 +71,10 @@
|
||||
842820F522DDD1E800C6F2D8 /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Extensions.swift; path = Pod/Classes/Extensions.swift; sourceTree = "<group>"; };
|
||||
842820FC22DDD21100C6F2D8 /* SideMenuPresentationStyle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SideMenuPresentationStyle.swift; path = Pod/Classes/SideMenuPresentationStyle.swift; sourceTree = "<group>"; };
|
||||
842820FE22DDD24200C6F2D8 /* SideMenuInteractionController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SideMenuInteractionController.swift; path = Pod/Classes/SideMenuInteractionController.swift; sourceTree = "<group>"; };
|
||||
8428210222E0449300C6F2D8 /* Deprecations.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Deprecations.swift; path = Pod/Classes/Deprecations.swift; sourceTree = "<group>"; };
|
||||
8432CC0122FFBCF4003D2BBD /* ExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8432CC0322FFBCF5003D2BBD /* ExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleTests.swift; sourceTree = "<group>"; };
|
||||
8432CC0522FFBCF5003D2BBD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
8461A2D11E145A08001DA4F8 /* UISideMenuNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UISideMenuNavigationController.swift; path = Pod/Classes/UISideMenuNavigationController.swift; sourceTree = "<group>"; };
|
||||
8461A2D21E145A08001DA4F8 /* UITableViewVibrantCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UITableViewVibrantCell.swift; path = Pod/Classes/UITableViewVibrantCell.swift; sourceTree = "<group>"; };
|
||||
84B489B21DD469B000D6CB43 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
|
||||
@@ -89,6 +103,13 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
8432CBFE22FFBCF4003D2BBD /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
@@ -104,6 +125,7 @@
|
||||
65FF1B3F1DE33097007B0845 /* Source */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8428210222E0449300C6F2D8 /* Deprecations.swift */,
|
||||
842820F522DDD1E800C6F2D8 /* Extensions.swift */,
|
||||
842820F422DDD1E800C6F2D8 /* Initializable.swift */,
|
||||
842820F122DDD1E800C6F2D8 /* Models.swift */,
|
||||
@@ -135,22 +157,13 @@
|
||||
path = Example;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7B48A0E91DCB2487002990A1 /* ExampleTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7B48A0EA1DCB2487002990A1 /* Tests.swift */,
|
||||
7B48A0EC1DCB2487002990A1 /* Info.plist */,
|
||||
);
|
||||
path = ExampleTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7B9DC8FA1DC6E8C1000D4007 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
65FF1B3F1DE33097007B0845 /* Source */,
|
||||
84B489B81DD469B900D6CB43 /* Podspec Metadata */,
|
||||
7B48A0D41DCB2487002990A1 /* Example */,
|
||||
7B48A0E91DCB2487002990A1 /* ExampleTests */,
|
||||
8432CC0222FFBCF5003D2BBD /* ExampleTests */,
|
||||
7B9DC9051DC6E8C1000D4007 /* Products */,
|
||||
9FB98148377EAEC00E35AC14 /* Pods */,
|
||||
9C94EEEBD250FF394115AAFC /* Frameworks */,
|
||||
@@ -162,10 +175,20 @@
|
||||
children = (
|
||||
7B9DC9041DC6E8C1000D4007 /* SideMenu.framework */,
|
||||
7B48A0D31DCB2487002990A1 /* Example.app */,
|
||||
8432CC0122FFBCF4003D2BBD /* ExampleTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8432CC0222FFBCF5003D2BBD /* ExampleTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8432CC0322FFBCF5003D2BBD /* ExampleTests.swift */,
|
||||
8432CC0522FFBCF5003D2BBD /* Info.plist */,
|
||||
);
|
||||
path = ExampleTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
84B489B81DD469B900D6CB43 /* Podspec Metadata */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -250,13 +273,31 @@
|
||||
productReference = 7B9DC9041DC6E8C1000D4007 /* SideMenu.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
8432CC0022FFBCF4003D2BBD /* ExampleTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 8432CC0822FFBCF5003D2BBD /* Build configuration list for PBXNativeTarget "ExampleTests" */;
|
||||
buildPhases = (
|
||||
8432CBFD22FFBCF4003D2BBD /* Sources */,
|
||||
8432CBFE22FFBCF4003D2BBD /* Frameworks */,
|
||||
8432CBFF22FFBCF4003D2BBD /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
8432CC0722FFBCF5003D2BBD /* PBXTargetDependency */,
|
||||
);
|
||||
name = ExampleTests;
|
||||
productName = ExampleTests;
|
||||
productReference = 8432CC0122FFBCF4003D2BBD /* ExampleTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.ui-testing";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
7B9DC8FB1DC6E8C1000D4007 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0800;
|
||||
LastSwiftUpdateCheck = 1030;
|
||||
LastUpgradeCheck = 0930;
|
||||
ORGANIZATIONNAME = jonkykong;
|
||||
TargetAttributes = {
|
||||
@@ -271,6 +312,12 @@
|
||||
LastSwiftMigration = 0900;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
8432CC0022FFBCF4003D2BBD = {
|
||||
CreatedOnToolsVersion = 10.3;
|
||||
DevelopmentTeam = QTJ767UH3L;
|
||||
ProvisioningStyle = Automatic;
|
||||
TestTargetID = 7B48A0D21DCB2487002990A1;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 7B9DC8FE1DC6E8C1000D4007 /* Build configuration list for PBXProject "SideMenu" */;
|
||||
@@ -289,6 +336,7 @@
|
||||
targets = (
|
||||
7B9DC9031DC6E8C1000D4007 /* SideMenu */,
|
||||
7B48A0D21DCB2487002990A1 /* Example */,
|
||||
8432CC0022FFBCF4003D2BBD /* ExampleTests */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
@@ -314,6 +362,13 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
8432CBFF22FFBCF4003D2BBD /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
@@ -382,12 +437,29 @@
|
||||
842820F722DDD1E800C6F2D8 /* Models.swift in Sources */,
|
||||
842820F622DDD1E800C6F2D8 /* SideMenuPresentationController.swift in Sources */,
|
||||
842820FA22DDD1E800C6F2D8 /* Initializable.swift in Sources */,
|
||||
8428210322E0449300C6F2D8 /* Deprecations.swift in Sources */,
|
||||
8461A2D61E145A08001DA4F8 /* UITableViewVibrantCell.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
8432CBFD22FFBCF4003D2BBD /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8432CC0422FFBCF5003D2BBD /* ExampleTests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
8432CC0722FFBCF5003D2BBD /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 7B48A0D21DCB2487002990A1 /* Example */;
|
||||
targetProxy = 8432CC0622FFBCF5003D2BBD /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
7B48A0ED1DCB2487002990A1 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
@@ -577,6 +649,53 @@
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
8432CC0922FFBCF5003D2BBD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = QTJ767UH3L;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
INFOPLIST_FILE = ExampleTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = co.massappeal.ExampleTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
TEST_TARGET_NAME = Example;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
8432CC0A22FFBCF5003D2BBD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = QTJ767UH3L;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
INFOPLIST_FILE = ExampleTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = co.massappeal.ExampleTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
TEST_TARGET_NAME = Example;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
@@ -607,6 +726,15 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
8432CC0822FFBCF5003D2BBD /* Build configuration list for PBXNativeTarget "ExampleTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
8432CC0922FFBCF5003D2BBD /* Debug */,
|
||||
8432CC0A22FFBCF5003D2BBD /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 7B9DC8FB1DC6E8C1000D4007 /* Project object */;
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0900"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "7B48A0D21DCB2487002990A1"
|
||||
BuildableName = "Example.app"
|
||||
BlueprintName = "Example"
|
||||
ReferencedContainer = "container:SideMenu.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "8432CC0022FFBCF4003D2BBD"
|
||||
BuildableName = "ExampleTests.xctest"
|
||||
BlueprintName = "ExampleTests"
|
||||
ReferencedContainer = "container:SideMenu.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "7B48A0D21DCB2487002990A1"
|
||||
BuildableName = "Example.app"
|
||||
BlueprintName = "Example"
|
||||
ReferencedContainer = "container:SideMenu.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "7B48A0D21DCB2487002990A1"
|
||||
BuildableName = "Example.app"
|
||||
BlueprintName = "Example"
|
||||
ReferencedContainer = "container:SideMenu.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "7B48A0D21DCB2487002990A1"
|
||||
BuildableName = "Example.app"
|
||||
BlueprintName = "Example"
|
||||
ReferencedContainer = "container:SideMenu.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
Reference in New Issue
Block a user