diff --git a/Example/Main.storyboard b/Example/Main.storyboard index 1cc6a97..29575a7 100644 --- a/Example/Main.storyboard +++ b/Example/Main.storyboard @@ -1,12 +1,11 @@ - + - - + @@ -133,7 +132,7 @@ - + diff --git a/Example/MainViewController.swift b/Example/MainViewController.swift index 5983c29..0c42552 100644 --- a/Example/MainViewController.swift +++ b/Example/MainViewController.swift @@ -35,59 +35,56 @@ class MainViewController: UIViewController { SideMenuManager.default.menuAddScreenEdgePanGesturesToPresent(toView: self.navigationController!.view) // Set up a cool background image for demo purposes - SideMenuManager.default.menuAnimationBackgroundColor = UIColor(patternImage: UIImage(named: "background")!) +// SideMenuManager.default.menuAnimationBackgroundColor = UIColor(patternImage: UIImage(named: "background")!) } fileprivate func setDefaults() { - let modes:[SideMenuManager.MenuPresentMode] = [.menuSlideIn, .viewSlideOut, .menuDissolveIn] - presentModeSegmentedControl.selectedSegmentIndex = modes.index(of: SideMenuManager.default.menuPresentMode)! - - let styles:[UIBlurEffect.Style] = [.dark, .light, .extraLight] - if let menuBlurEffectStyle = SideMenuManager.default.menuBlurEffectStyle { - blurSegmentControl.selectedSegmentIndex = styles.index(of: menuBlurEffectStyle) ?? 0 - } else { - blurSegmentControl.selectedSegmentIndex = 0 - } - - darknessSlider.value = Float(SideMenuManager.default.menuAnimationFadeStrength) - shadowOpacitySlider.value = Float(SideMenuManager.default.menuShadowOpacity) - shrinkFactorSlider.value = Float(SideMenuManager.default.menuAnimationTransformScaleFactor) - screenWidthSlider.value = Float(SideMenuManager.default.menuWidth / view.frame.width) - blackOutStatusBar.isOn = SideMenuManager.default.menuFadeStatusBar +// let styles:[UIBlurEffect.Style] = [.dark, .light, .extraLight] +// if let menuBlurEffectStyle = SideMenuManager.default.menuBlurEffectStyle { +// blurSegmentControl.selectedSegmentIndex = styles.index(of: menuBlurEffectStyle) ?? 0 +// } else { +// blurSegmentControl.selectedSegmentIndex = 0 +// } +// +// darknessSlider.value = Float(SideMenuManager.default.menuAnimationFadeStrength) +// shadowOpacitySlider.value = Float(SideMenuManager.default.menuShadowOpacity) +// shrinkFactorSlider.value = Float(SideMenuManager.default.menuAnimationTransformScaleFactor) +// screenWidthSlider.value = Float(SideMenuManager.default.menuWidth / view.frame.width) +// blackOutStatusBar.isOn = SideMenuManager.default.menuFadeStatusBar } @IBAction fileprivate func changeSegment(_ segmentControl: UISegmentedControl) { - switch segmentControl { - case presentModeSegmentedControl: - let modes:[SideMenuManager.MenuPresentMode] = [.menuSlideIn, .viewSlideOut, .viewSlideInOut, .menuDissolveIn] - SideMenuManager.default.menuPresentMode = modes[segmentControl.selectedSegmentIndex] - case blurSegmentControl: - if segmentControl.selectedSegmentIndex == 0 { - SideMenuManager.default.menuBlurEffectStyle = nil - } else { - let styles:[UIBlurEffect.Style] = [.dark, .light, .extraLight] - SideMenuManager.default.menuBlurEffectStyle = styles[segmentControl.selectedSegmentIndex - 1] - } - default: break; - } +// switch segmentControl { +// case presentModeSegmentedControl: +// let modes:[MenuPresentStyle] = [.menuSlideIn, .viewSlideOut, .viewSlideInOut, .menuDissolveIn] +// SideMenuManager.default.menuPresentStyle = modes[segmentControl.selectedSegmentIndex] +// case blurSegmentControl: +// if segmentControl.selectedSegmentIndex == 0 { +// SideMenuManager.default.menuBlurEffectStyle = nil +// } else { +// let styles:[UIBlurEffect.Style] = [.dark, .light, .extraLight] +// SideMenuManager.default.menuBlurEffectStyle = styles[segmentControl.selectedSegmentIndex - 1] +// } +// default: break; +// } } @IBAction fileprivate func changeSlider(_ slider: UISlider) { - switch slider { - case darknessSlider: - SideMenuManager.default.menuAnimationFadeStrength = CGFloat(slider.value) - case shadowOpacitySlider: - SideMenuManager.default.menuShadowOpacity = slider.value - case shrinkFactorSlider: - SideMenuManager.default.menuAnimationTransformScaleFactor = CGFloat(slider.value) - case screenWidthSlider: - SideMenuManager.default.menuWidth = view.frame.width * CGFloat(slider.value) - default: break; - } +// switch slider { +// case darknessSlider: +// SideMenuManager.default.menuAnimationFadeStrength = CGFloat(slider.value) +// case shadowOpacitySlider: +// SideMenuManager.default.menuShadowOpacity = slider.value +// case shrinkFactorSlider: +// SideMenuManager.default.menuAnimationTransformScaleFactor = CGFloat(slider.value) +// case screenWidthSlider: +// SideMenuManager.default.menuWidth = view.frame.width * CGFloat(slider.value) +// default: break; +// } } @IBAction fileprivate func changeSwitch(_ switchControl: UISwitch) { - SideMenuManager.default.menuFadeStatusBar = switchControl.isOn +// SideMenuManager.default.menuFadeStatusBar = switchControl.isOn } } diff --git a/Example/SideMenuTableViewController.swift b/Example/SideMenuTableViewController.swift index e669f57..3b7693d 100644 --- a/Example/SideMenuTableViewController.swift +++ b/Example/SideMenuTableViewController.swift @@ -17,7 +17,7 @@ class SideMenuTableViewController: UITableViewController { // refresh cell blur effect in case it changed tableView.reloadData() - guard SideMenuManager.default.menuBlurEffectStyle == nil else { + guard let menu = navigationController as? UISideMenuNavigationController, menu.blurEffectStyle == nil else { return } @@ -30,8 +30,10 @@ class SideMenuTableViewController: UITableViewController { override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = super.tableView(tableView, cellForRowAt: indexPath) as! UITableViewVibrantCell - - cell.blurEffectStyle = SideMenuManager.default.menuBlurEffectStyle + + if let menu = navigationController as? UISideMenuNavigationController { + cell.blurEffectStyle = menu.blurEffectStyle + } return cell } diff --git a/Pod/Classes/Print.swift b/Pod/Classes/Print.swift new file mode 100644 index 0000000..b5ab3fe --- /dev/null +++ b/Pod/Classes/Print.swift @@ -0,0 +1,42 @@ +// +// Print.swift +// SideMenu +// +// Created by Jon Kent on 12/5/18. +// + +import Foundation + +public enum Print: String { case + panGestureAdded = "%@ was called before %@ or %@ was set. Gestures will not work without a menu.", + screenGestureAdded = "%@ was called before %@ was set. The gesture will not work without a menu. Use %@ to add gestures for only one menu.", + 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.", + property = "a menu's %@ property can only be changed when it is hidden.", + emptyMenu = "SideMenu Warning: the menu doesn't have a view controller to show! UISideMenuNavigationController needs a view controller to display just like a UINavigationController.", + cannotPush = "SideMenu Warning: attempt to push a View Controller from %@ where its navigationController == nil. It must be embedded in a UINavigationController for this to work." + + internal static func warning(_ print: Print, arguments: CVarArg..., required: Bool = false) { + warning(String(format: print.rawValue, arguments), required: required) + } + + internal 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) { + let message = "SideMenu Warning: \(message)" + + if required { + print(message) + return + } + #if !STFU_SIDEMENU + print(message) + #endif + } + +} diff --git a/Pod/Classes/Protected.swift b/Pod/Classes/Protected.swift new file mode 100644 index 0000000..bef7e73 --- /dev/null +++ b/Pod/Classes/Protected.swift @@ -0,0 +1,49 @@ +// +// Protected.swift +// SideMenu +// +// Created by Jon Kent on 2/9/19. +// + +import Foundation + +open class Protected { + + typealias ConditionBlock = () -> Bool + typealias Block = (Protected) -> Void + + private var _value: T + private var conditionBlock: ConditionBlock + private var thenBlock: Block? + private var elseBlock: Block? + + open var value: T { + get { + return _value + } + set { + guard conditionBlock() else { + elseBlock?(self) + //Print.warning(.property, arguments: warning, required: true) + return + } + _value = newValue + thenBlock?(self) + } + } + +// func set(_ newValue: T, if condition: ConditionBlock) { +// guard condition else { +// //Print.warning(.property, arguments: warning, required: true) +// return +// } +// _value = newValue +// } + + init(_ value: T, if conditionBlock: @escaping ConditionBlock, then thenBlock: Block? = nil, else elseBlock: Block? = nil) { + self._value = value + self.conditionBlock = conditionBlock + self.thenBlock = thenBlock + self.elseBlock = elseBlock + } +} diff --git a/Pod/Classes/SideMenuGestureManager.swift b/Pod/Classes/SideMenuGestureManager.swift new file mode 100644 index 0000000..67b7d5b --- /dev/null +++ b/Pod/Classes/SideMenuGestureManager.swift @@ -0,0 +1,199 @@ +// +// SideMenuGestureManager.swift +// SideMenu +// +// Created by Jon Kent on 12/9/18. +// + +import UIKit + +internal protocol SideMenuGestureManagerDelegate: class { + func gestureManagerWidthForMenu(_ gestureManager: SideMenuGestureManager) -> CGFloat? + func gestureManager(_ gestureManager: SideMenuGestureManager, changedState state: SideMenuGestureManager.State, presenting: Bool) +} + +internal class SideMenuGestureManager { + + enum State { case + start(progress: CGFloat), + update(progress: CGFloat), + switching(progress: CGFloat), + finish, + cancel + } + + private(set) var leftSide: Bool = false + private weak var activeGesture: UIPanGestureRecognizer? + + weak var delegate: SideMenuGestureManagerDelegate? + + var isTracking: Bool { + return activeGesture != nil + } + + func addPresentScreenEdgePanGestures(to view: UIView, for sides: [UIRectEdge] = [.left, .right]) -> [UIScreenEdgePanGestureRecognizer] { + return sides.map { edge in + let gesture = addScreenEdgeGesture(toView: view, edge: edge) + gesture.addTarget(self, action:#selector(handlePresentMenuScreenEdge(_:))) + return gesture + } + } + + @discardableResult func addPresentPanGesture(to view: UIView) -> UIPanGestureRecognizer { + let panGestureRecognizer = UIPanGestureRecognizer() + panGestureRecognizer.addTarget(self, action:#selector(handlePresentMenuPan(_:))) + view.addGestureRecognizer(panGestureRecognizer) + return panGestureRecognizer + } + + @discardableResult func addDismissPanGesture(to view: UIView) -> UIPanGestureRecognizer { + let panGestureRecognizer = UIPanGestureRecognizer() + panGestureRecognizer.cancelsTouchesInView = false + panGestureRecognizer.addTarget(self, action:#selector(handleDismissMenuPan(_:))) + view.addGestureRecognizer(panGestureRecognizer) + return panGestureRecognizer + } + + func addDismissGestures(to view: UIView?) { + guard let view = view else { return } + + addDismissPanGesture(to: view) + + let tapGestureRecognizer = UITapGestureRecognizer() + tapGestureRecognizer.addTarget(self, action: #selector(handleDismissMenuTap(_:))) + view.addGestureRecognizer(tapGestureRecognizer) + } +} + +private extension SideMenuGestureManager { + + var width: CGFloat { + return delegate?.gestureManagerWidthForMenu(self) ?? 0 + } + + func factor(_ presenting: Bool) -> CGFloat { + return presenting ? presentFactor : hideFactor + } + + var presentFactor: CGFloat { + return leftSide ? 1 : -1 + } + + var hideFactor: CGFloat { + return -presentFactor + } + + @objc func handlePresentMenuScreenEdge(_ gesture: UIScreenEdgePanGestureRecognizer) { + handleMenuPan(gesture, presenting: true) + } + + @objc func handleDismissMenuTap(_ tap: UITapGestureRecognizer) { + guard let delegate = delegate else { return } + delegate.gestureManager(self, changedState: .finish, presenting: false) + } + + @objc func handlePresentMenuPan(_ gesture: UIPanGestureRecognizer) { + handleMenuPan(gesture, presenting: true) + } + + @objc func handleDismissMenuPan(_ gesture: UIPanGestureRecognizer) { + handleMenuPan(gesture, presenting: false) + } + + func addScreenEdgeGesture(toView: UIView, edge: UIRectEdge) -> UIScreenEdgePanGestureRecognizer { + let screenEdgeGestureRecognizer = UIScreenEdgePanGestureRecognizer() + screenEdgeGestureRecognizer.cancelsTouchesInView = true + screenEdgeGestureRecognizer.edges = edge + toView.addGestureRecognizer(screenEdgeGestureRecognizer) + return screenEdgeGestureRecognizer + } + + func handleMenuPan(_ gesture: UIPanGestureRecognizer, presenting: Bool) { + guard let delegate = delegate else { return } + + if activeGesture == nil { + if presenting { + if let gesture = gesture as? UIScreenEdgePanGestureRecognizer { + leftSide = gesture.edges.contains(.left) + } else { + // not sure which way the user is swiping yet, so do nothing + if gesture.xTranslation == 0 { return } + leftSide = gesture.xTranslation > 0 + } + } + + activeGesture = gesture + } else if gesture != activeGesture { + gesture.isEnabled = false + gesture.isEnabled = true + return + } + + let distance = gesture.xTranslation / width + let progress = max(min(distance * factor(presenting), 1), 0) + switch (gesture.state) { + case .began: + delegate.gestureManager(self, changedState: .start(progress: progress), presenting: presenting) + case .changed: + if presenting && gesture.canSwitch { + let switching = (distance > 0 && !leftSide) || (distance < 0 && leftSide) + if switching { + leftSide = !leftSide + delegate.gestureManager(self, changedState: .switching(progress: progress), presenting: presenting) + return + } + } + delegate.gestureManager(self, changedState: .update(progress: progress), presenting: presenting) + default: + let velocity = gesture.xVelocity * factor(presenting) + let finished = velocity >= 100 || velocity >= -50 && abs(distance) >= 0.5 + delegate.gestureManager(self, changedState: finished ? .finish : .cancel, presenting: presenting) + self.activeGesture = nil + } + } +} + +private extension UIPanGestureRecognizer { + + var canSwitch: Bool { + return !(self is UIScreenEdgePanGestureRecognizer) + } + + var presentDirection: SideMenuManager.PresentDirection { + return xTranslation > 0 ? .left : .right + } + + var xTranslation: CGFloat { + return view?.untransform { + return self.translation(in: view).x + } ?? 0 + } + + var xVelocity: CGFloat { + return view?.untransform { + return self.velocity(in: view).x + } ?? 0 + } +} + +internal extension UIView { + + @discardableResult func untransform(_ code: () -> CGFloat) -> CGFloat { + let transform = self.transform + self.transform = .identity + let value = code() + self.transform = transform + return value + } + + func untransform(_ code: () -> Void) { + untransform { () -> CGFloat in + code() + return 0 + } + } + + func bringToFront() { + self.superview?.bringSubviewToFront(self) + } +} diff --git a/Pod/Classes/SideMenuInteractionController.swift b/Pod/Classes/SideMenuInteractionController.swift new file mode 100644 index 0000000..94ed8a7 --- /dev/null +++ b/Pod/Classes/SideMenuInteractionController.swift @@ -0,0 +1,34 @@ +// +// SideMenuInteractiveTransitionController.swift +// SideMenu +// +// Created by Jon Kent on 12/28/18. +// + +import UIKit + +internal class SideMenuInteractionController: UIPercentDrivenInteractiveTransition { + + private(set) var isCancelled: Bool = false + private(set) var isFinished: Bool = false + + init(completionCurve: UIView.AnimationCurve = .easeIn) { + super.init() + self.completionCurve = completionCurve + } + + override func cancel() { + isCancelled = true + super.cancel() + } + + override func finish() { + isFinished = true + super.finish() + } + + override func update(_ percentComplete: CGFloat) { + guard !isCancelled && !isFinished else { return } + super.update(percentComplete) + } +} diff --git a/Pod/Classes/SideMenuManager.swift b/Pod/Classes/SideMenuManager.swift index b9ffaf4..7fd2bb9 100644 --- a/Pod/Classes/SideMenuManager.swift +++ b/Pod/Classes/SideMenuManager.swift @@ -16,29 +16,28 @@ SideMenuManager.menuAddScreenEdgePanGesturesToPresent(toView: self.navigationController!.view) */ +import UIKit + @objcMembers open class SideMenuManager: NSObject { - - @objc public enum MenuPushStyle: Int { - case defaultBehavior, - popWhenPossible, - replace, - preserve, - preserveAndHideBackButton, - subMenu - } - - @objc public enum MenuPresentMode: Int { - case menuSlideIn, - viewSlideOut, - viewSlideInOut, - menuDissolveIn - } - - // Bounds which has been allocated for the app on the whole device screen - internal static var appScreenRect: CGRect { - let appWindowRect = UIApplication.shared.keyWindow?.bounds ?? UIWindow().bounds - return appWindowRect + + public enum PresentDirection: Int { case + left = 1, + right = 0 + + var edge: UIRectEdge { + switch self { + case .left: return .left + case .right: return .right + } + } + + var name: String { + switch self { + case .left: return "menuLeftNavigationController" + case .right: return "menuRightNavigationController" + } + } } /** @@ -52,292 +51,184 @@ open class SideMenuManager: NSObject { - replace: Any existing view controllers are released from the stack and replaced with the pushed view controller. Back buttons are automatically hidden. This behavior is ideal if view controllers require a lot of memory or their state doesn't need to be preserved.. - subMenu: Unlike all other behaviors that push using the menu's presentingViewController, this behavior pushes view controllers within the menu. Use this behavior if you want to display a sub menu. */ - open var menuPushStyle: MenuPushStyle = .defaultBehavior +// open var menuPushStyle: MenuPushStyle = .defaultBehavior /** - The presentation mode of the menu. + The presentation stayle of the menu. - There are four modes in MenuPresentMode: + There are four modes in MenuPresentStyle: - menuSlideIn: Menu slides in over of the existing view. - viewSlideOut: The existing view slides out to reveal the menu. - viewSlideInOut: The existing view slides out while the menu slides in. - menuDissolveIn: The menu dissolves in over the existing view controller. */ - open var menuPresentMode: MenuPresentMode = .viewSlideOut - +// open var menuPresentStyle: MenuPresentStyle = .viewSlideOut + /// Prevents the same view controller (or a view controller of the same class) from being pushed more than once. Defaults to true. - open var menuAllowPushOfSameClassTwice = true +// open 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 or 240 points, whichever is smaller. Note that each menu's width can be overridden using the `menuWidth` property on any `UISideMenuNavigationController` instance. */ - open var menuWidth: CGFloat = min(round(min((appScreenRect.width), (appScreenRect.height)) * 0.75), 240) - +// open var menuWidth: CGFloat = { +// let appScreenRect = UIApplication.shared.keyWindow?.bounds ?? UIWindow().bounds +// let minimumSize = min(appScreenRect.width, appScreenRect.height) +// return min(round(minimumSize * 0.75), 240) +// }() + /// Duration of the animation when the menu is presented without gestures. Default is 0.35 seconds. - open var menuAnimationPresentDuration: Double = 0.35 - +// open var menuAnimationPresentDuration: Double = 0.35 + /// Duration of the animation when the menu is dismissed without gestures. Default is 0.35 seconds. - open var menuAnimationDismissDuration: Double = 0.35 - +// open var menuAnimationDismissDuration: Double = 0.35 + /// Duration of the remaining animation when the menu is partially dismissed with gestures. Default is 0.35 seconds. - open var menuAnimationCompleteGestureDuration: Double = 0.35 - +// open 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 var menuAnimationFadeStrength: CGFloat = 0 - +// open var menuAnimationFadeStrength: CGFloat = 0 + /// The amount to scale the existing view controller or the menu view controller depending on the `menuPresentMode`. Default is 1 for no scaling. Less than 1 will shrink, greater than 1 will grow. - open var menuAnimationTransformScaleFactor: CGFloat = 1 - +// open var menuAnimationTransformScaleFactor: CGFloat = 1 + /// The background color behind menu animations. Depending on the animation settings this may not be visible. If `menuFadeStatusBar` is true, this color is used to fade it. Default is black. - open var menuAnimationBackgroundColor: UIColor? - +// open var menuAnimationBackgroundColor: UIColor? + /// The shadow opacity around the menu view controller or existing view controller depending on the `menuPresentMode`. Default is 0.5 for 50% opacity. - open var menuShadowOpacity: Float = 0.5 - +// open var menuShadowOpacity: Float = 0.5 + /// The shadow color around the menu view controller or existing view controller depending on the `menuPresentMode`. Default is black. - open var menuShadowColor = UIColor.black - +// open var menuShadowColor = UIColor.black + /// The radius of the shadow around the menu view controller or existing view controller depending on the `menuPresentMode`. Default is 5. - open var menuShadowRadius: CGFloat = 5 - +// open var menuShadowRadius: CGFloat = 5 + /// Enable or disable interaction with the presenting view controller while the menu is displayed. Enabling may make it difficult to dismiss the menu or cause exceptions if the user tries to present and already presented menu. Default is false. - open var menuPresentingViewControllerUserInteractionEnabled: Bool = false - +// open var menuPresentingViewControllerUserInteractionEnabled: Bool = false + /// The strength of the parallax effect on the existing view controller. Does not apply to `menuPresentMode` when set to `ViewSlideOut`. Default is 0. - open var menuParallaxStrength: Int = 0 - +// open var menuParallaxStrength: Int = 0 + /// Draws the `menuAnimationBackgroundColor` behind the status bar. Default is true. - open var menuFadeStatusBar = true - +// open var menuFadeStatusBar = true + /// The animation options when a menu is displayed. Ignored when displayed with a gesture. - open var menuAnimationOptions: UIView.AnimationOptions = .curveEaseInOut +// open var menuAnimationOptions: UIView.AnimationOptions = .curveEaseInOut /// Animation curve of the remaining animation when the menu is partially dismissed with gestures. Default is .easeIn. - open var menuAnimationCompletionCurve: UIView.AnimationCurve = .easeIn - +// open var menuAnimationCompletionCurve: UIView.AnimationCurve = .easeIn + /// The animation spring damping when a menu is displayed. Ignored when displayed with a gesture. - open var menuAnimationUsingSpringWithDamping: CGFloat = 1 - +// open var menuAnimationUsingSpringWithDamping: CGFloat = 1 + /// The animation initial spring velocity when a menu is displayed. Ignored when displayed with a gesture. - open var menuAnimationInitialSpringVelocity: CGFloat = 1 - +// open 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 var menuDismissOnPush = true - +// open var menuDismissOnPush = true + /// Forces menus to always animate when appearing or disappearing, regardless of a pushed view controller's animation. - open var menuAlwaysAnimate = false - +// open var menuAlwaysAnimate = false + /// Automatically dismisses the menu when app goes to the background. - open var menuDismissWhenBackgrounded = true - +// open var menuDismissWhenBackgrounded = true + /// Default instance of SideMenuManager. public static let `default` = SideMenuManager() - + +// public static var globalPresentStyle: MenuPresentStyle = .viewSlideOut +// public static var globalPushStyle: MenuPushStyle = .defaultBehavior + + + +// public static var menuOptions = UISideMenuNavigationController.Options() + /// Default instance of SideMenuManager (objective-C). open class var defaultManager: SideMenuManager { return SideMenuManager.default } - - internal var transition: SideMenuTransition! - - public override init() { + + internal lazy var gestureManager: SideMenuGestureManager = { + let gestureManager = SideMenuGestureManager() + gestureManager.delegate = self + return gestureManager + }() + + private var rotating: Bool = false + private weak var switchToMenu: Menu? + + override init() { super.init() - transition = SideMenuTransition(sideMenuManager: self) + let notificationNames: [NSNotification.Name] = [ + UIApplication.didEnterBackgroundNotification, + UIApplication.willChangeStatusBarOrientationNotification, + UIApplication.didChangeStatusBarOrientationNotification, + UIApplication.willChangeStatusBarFrameNotification + ] + notificationNames.forEach { + NotificationCenter.default.addObserver(self, selector:#selector(handleNotification), name: $0, object: nil) + } } - + /** The blur effect style of the menu if the menu's root view controller is a UITableViewController or UICollectionViewController. - Note: If you want cells in a UITableViewController menu to show vibrancy, make them a subclass of UITableViewVibrantCell. */ - open var menuBlurEffectStyle: UIBlurEffect.Style? { - didSet { - if oldValue != menuBlurEffectStyle { - updateMenuBlurIfNecessary() - } - } - } - +// open var menuBlurEffectStyle: UIBlurEffect.Style? { +// didSet { +// if oldValue != menuBlurEffectStyle { +// updateBlurIfNecessary() +// } +// } +// } + /// The left menu. open var menuLeftNavigationController: UISideMenuNavigationController? { - willSet { - guard menuLeftNavigationController != newValue, menuLeftNavigationController?.presentingViewController == nil else { - return - } - menuLeftNavigationController?.locked = false - removeMenuBlurForMenu(menuLeftNavigationController) - } didSet { - guard menuLeftNavigationController != oldValue else { - return - } - guard oldValue?.presentingViewController == nil else { - print("SideMenu Warning: menuLeftNavigationController cannot be modified while it's presented.") + if !setMenu(from: oldValue, to: menuLeftNavigationController, side: .left) { menuLeftNavigationController = oldValue - return } - - setupNavigationController(menuLeftNavigationController, leftSide: true) } } /// The right menu. open var menuRightNavigationController: UISideMenuNavigationController? { - willSet { - guard menuRightNavigationController != newValue, menuRightNavigationController?.presentingViewController == nil else { - return - } - removeMenuBlurForMenu(menuRightNavigationController) - } didSet { - guard menuRightNavigationController != oldValue else { - return - } - guard oldValue?.presentingViewController == nil else { - print("SideMenu Warning: menuRightNavigationController cannot be modified while it's presented.") + if !setMenu(from: oldValue, to: menuRightNavigationController, side: .right) { menuRightNavigationController = oldValue - return - } - setupNavigationController(menuRightNavigationController, leftSide: false) - } - } - - /// The left menu swipe to dismiss gesture. - open weak var menuLeftSwipeToDismissGesture: UIPanGestureRecognizer? { - didSet { - oldValue?.view?.removeGestureRecognizer(oldValue!) - setupGesture(gesture: menuLeftSwipeToDismissGesture) - } - } - - /// The right menu swipe to dismiss gesture. - open weak var menuRightSwipeToDismissGesture: UIPanGestureRecognizer? { - didSet { - oldValue?.view?.removeGestureRecognizer(oldValue!) - setupGesture(gesture: menuRightSwipeToDismissGesture) - } - } - - fileprivate func setupGesture(gesture: UIPanGestureRecognizer?) { - guard let gesture = gesture else { - return - } - - gesture.addTarget(transition, action:#selector(SideMenuTransition.handleHideMenuPan(_:))) - } - - fileprivate func setupNavigationController(_ forMenu: UISideMenuNavigationController?, leftSide: Bool) { - guard let forMenu = forMenu else { - return - } - - forMenu.transitioningDelegate = transition - forMenu.modalPresentationStyle = .overFullScreen - forMenu.leftSide = leftSide - - if forMenu.sideMenuManager != self { - #if !STFU_SIDEMENU - if forMenu.sideMenuManager?.menuLeftNavigationController == forMenu { - print("SideMenu Warning: \(String(describing: forMenu.self)) was already assigned to the menuLeftNavigationController of \(String(describing: forMenu.sideMenuManager!.self)). 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.") - } else if forMenu.sideMenuManager?.menuRightNavigationController == forMenu { - print("SideMenu Warning: \(String(describing: forMenu.self)) was already assigned to the menuRightNavigationController of \(String(describing: forMenu.sideMenuManager!.self)). 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.") - } - #endif - forMenu.sideMenuManager = self - } - - forMenu.locked = true - - if menuEnableSwipeGestures { - let exitPanGesture = UIPanGestureRecognizer() - exitPanGesture.cancelsTouchesInView = false - forMenu.view.addGestureRecognizer(exitPanGesture) - if leftSide { - menuLeftSwipeToDismissGesture = exitPanGesture - } else { - menuRightSwipeToDismissGesture = exitPanGesture } } - - // Ensures minimal lag when revealing the menu for the first time using gestures by loading the view: - let _ = forMenu.topViewController?.view - - updateMenuBlurIfNecessary() } +// /// The left menu swipe to dismiss gesture. +// open private(set) weak var menuLeftSwipeToDismissGesture: UIPanGestureRecognizer? { +// didSet { +// oldValue?.view?.removeGestureRecognizer(oldValue!) +// } +// } +// +// /// The right menu swipe to dismiss gesture. +// open private(set) weak var menuRightSwipeToDismissGesture: UIPanGestureRecognizer? { +// didSet { +// oldValue?.view?.removeGestureRecognizer(oldValue!) +// } +// } + /// Enable or disable gestures that would swipe to dismiss the menu. Default is true. - open var menuEnableSwipeGestures: Bool = true { - didSet { - menuLeftSwipeToDismissGesture?.view?.removeGestureRecognizer(menuLeftSwipeToDismissGesture!) - menuRightSwipeToDismissGesture?.view?.removeGestureRecognizer(menuRightSwipeToDismissGesture!) - setupNavigationController(menuLeftNavigationController, leftSide: true) - setupNavigationController(menuRightNavigationController, leftSide: false) - } - } - - fileprivate func updateMenuBlurIfNecessary() { - if let menuLeftNavigationController = self.menuLeftNavigationController { - setupMenuBlurForMenu(menuLeftNavigationController) - } - if let menuRightNavigationController = self.menuRightNavigationController { - setupMenuBlurForMenu(menuRightNavigationController) - } - } - - fileprivate func setupMenuBlurForMenu(_ forMenu: UISideMenuNavigationController?) { - removeMenuBlurForMenu(forMenu) - - guard let forMenu = forMenu, - let menuBlurEffectStyle = menuBlurEffectStyle, - let view = forMenu.topViewController?.view, - !UIAccessibility.isReduceTransparencyEnabled else { - return - } - - if forMenu.originalMenuBackgroundColor == nil { - forMenu.originalMenuBackgroundColor = view.backgroundColor - } - - let blurEffect = UIBlurEffect(style: menuBlurEffectStyle) - let blurView = UIVisualEffectView(effect: blurEffect) - view.backgroundColor = UIColor.clear - if let tableViewController = forMenu.topViewController as? UITableViewController { - tableViewController.tableView.backgroundView = blurView - tableViewController.tableView.separatorEffect = UIVibrancyEffect(blurEffect: blurEffect) - tableViewController.tableView.reloadData() - } else { - blurView.autoresizingMask = [.flexibleHeight, .flexibleWidth] - blurView.frame = view.bounds - view.insertSubview(blurView, at: 0) - } - } - - fileprivate func removeMenuBlurForMenu(_ forMenu: UISideMenuNavigationController?) { - guard let forMenu = forMenu, - let originalMenuBackgroundColor = forMenu.originalMenuBackgroundColor, - let view = forMenu.topViewController?.view else { - return - } - - view.backgroundColor = originalMenuBackgroundColor - forMenu.originalMenuBackgroundColor = nil - - if let tableViewController = forMenu.topViewController as? UITableViewController { - tableViewController.tableView.backgroundView = nil - tableViewController.tableView.separatorEffect = nil - tableViewController.tableView.reloadData() - } else if let blurView = view.subviews[0] as? UIVisualEffectView { - blurView.removeFromSuperview() - } - } - +// open var menuEnableSwipeGestures: Bool = true { +// didSet { +// setupSwipeGestures() +// } +// } + /** Adds screen edge gestures to a view to present a menu. @@ -346,42 +237,17 @@ open class SideMenuManager: NSObject { - Returns: The array of screen edge gestures added to `toView`. */ - @discardableResult open func menuAddScreenEdgePanGesturesToPresent(toView: UIView, forMenu:UIRectEdge? = nil) -> [UIScreenEdgePanGestureRecognizer] { - var array = [UIScreenEdgePanGestureRecognizer]() - - let newScreenEdgeGesture = { () -> UIScreenEdgePanGestureRecognizer in - let screenEdgeGestureRecognizer = UIScreenEdgePanGestureRecognizer() - screenEdgeGestureRecognizer.cancelsTouchesInView = true - toView.addGestureRecognizer(screenEdgeGestureRecognizer) - array.append(screenEdgeGestureRecognizer) - return screenEdgeGestureRecognizer - } - - if forMenu != .right { - let leftScreenEdgeGestureRecognizer = newScreenEdgeGesture() - leftScreenEdgeGestureRecognizer.addTarget(transition, action:#selector(SideMenuTransition.handlePresentMenuLeftScreenEdge(_:))) - leftScreenEdgeGestureRecognizer.edges = .left - - #if !STFU_SIDEMENU - if menuLeftNavigationController == nil { - print("SideMenu Warning: menuAddScreenEdgePanGesturesToPresent was called before menuLeftNavigationController was set. The gesture will not work without a menu. Use menuAddScreenEdgePanGesturesToPresent(toView:forMenu:) to add gestures for only one menu.") + @discardableResult open func menuAddScreenEdgePanGesturesToPresent(toView view: UIView, forMenu sides: [PresentDirection] = [.left, .right]) -> [UIScreenEdgePanGestureRecognizer] { + sides.forEach { side in + if menu(forSide: side) == nil { + let methodName = #function // "menuAddScreenEdgePanGesturesToPresent" + let suggestedMethodName = "menuAddScreenEdgePanGesturesToPresent(toView:forMenu:)" + Print.warning(.screenGestureAdded, arguments: methodName, side.name, suggestedMethodName) } - #endif } - - if forMenu != .left { - let rightScreenEdgeGestureRecognizer = newScreenEdgeGesture() - rightScreenEdgeGestureRecognizer.addTarget(transition, action:#selector(SideMenuTransition.handlePresentMenuRightScreenEdge(_:))) - rightScreenEdgeGestureRecognizer.edges = .right - - #if !STFU_SIDEMENU - if menuRightNavigationController == nil { - print("SideMenu Warning: menuAddScreenEdgePanGesturesToPresent was called before menuRightNavigationController was set. The gesture will not work without a menu. Use menuAddScreenEdgePanGesturesToPresent(toView:forMenu:) to add gestures for only one menu.") - } - #endif - } - - return array + + let edges: [UIRectEdge] = sides.map { $0.edge } + return gestureManager.addPresentScreenEdgePanGestures(to: view, for: edges) } /** @@ -391,15 +257,258 @@ open class SideMenuManager: NSObject { - Returns: The pan gesture added to `toView`. */ - @discardableResult open func menuAddPanGestureToPresent(toView: UIView) -> UIPanGestureRecognizer { - let panGestureRecognizer = UIPanGestureRecognizer() - panGestureRecognizer.addTarget(transition, action:#selector(SideMenuTransition.handlePresentMenuPan(_:))) - toView.addGestureRecognizer(panGestureRecognizer) - + @discardableResult open func menuAddPanGestureToPresent(toView view: UIView) -> UIPanGestureRecognizer { if menuLeftNavigationController ?? menuRightNavigationController == nil { - print("SideMenu Warning: menuAddPanGestureToPresent called before menuLeftNavigationController or menuRightNavigationController have been defined. Gestures will not work without a menu.") + Print.warning(.panGestureAdded, arguments: #function, PresentDirection.left.name, PresentDirection.right.name, required: true) } - return panGestureRecognizer + return gestureManager.addPresentPanGesture(to: view) } } + +extension SideMenuManager: SideMenuTransitionControllerDelegate { + + internal func sideMenuTransitionController(_ transitionController: SideMenuTransitionController, animationEnded transitionCompleted: Bool) { + if transitionController.presenting && transitionCompleted { + gestureManager.addDismissGestures(to: transitionController.tapView) + return + } + + if let switchToMenu = switchToMenu { + self.switchToMenu = nil + SideMenuManager.visibleViewController?.present(switchToMenu, animated: true, completion: nil) + } + } +} + +extension SideMenuManager: SideMenuGestureManagerDelegate { + + internal func gestureManager(_ gestureManager: SideMenuGestureManager, changedState state: SideMenuGestureManager.State, presenting: Bool) { + guard gestureManager.isTracking else { + if presenting { + guard let menu = menu(forLeftSide: gestureManager.leftSide) else { return } + SideMenuManager.visibleViewController?.present(menu, animated: true, completion: nil) + } else { + activeMenu?.dismiss(animated: true, completion: nil) + } + return + } + + switch state { + case .start(let progress): + if presenting { + guard let menu = menu(forLeftSide: gestureManager.leftSide) else { return } + SideMenuManager.visibleViewController?.present(menu, animated: true, completion: nil) + } else { + activeMenu?.dismiss(animated: true, completion: nil) + } + activeMenu?.transitionController?.interactionController?.update(progress) + case .update(let progress): + activeMenu?.transitionController?.interactionController?.update(progress) + case .switching: + switchToMenu = menu(forLeftSide: gestureManager.leftSide) + activeMenu?.transitionController?.interactionController?.cancel() + case .finish: + switchToMenu = nil + activeMenu?.transitionController?.interactionController?.finish() + case .cancel: + switchToMenu = nil + activeMenu?.transitionController?.interactionController?.cancel() + } + } + + internal func gestureManagerWidthForMenu(_ gestureManager: SideMenuGestureManager) -> CGFloat? { + return menu(forLeftSide: gestureManager.leftSide)?.menuWidth + } +} + +internal extension SideMenuManager { + + func setMenu(_ menu: Menu?, forLeftSide leftSide: Bool) { + switch leftSide { + case true: menuLeftNavigationController = menu + case false: menuRightNavigationController = menu + } + } +} + +private extension SideMenuManager { + + var activeMenu: Menu? { + if menuLeftNavigationController?.isHidden == false { return menuLeftNavigationController } + if menuRightNavigationController?.isHidden == false { return menuRightNavigationController } + return nil + } + + func menu(forSide: PresentDirection) -> Menu? { + switch forSide { + case .left: return menuLeftNavigationController + case .right: return menuRightNavigationController + } + } + + func menu(forLeftSide leftSide: Bool) -> Menu? { + return menu(forSide: leftSide ? .left : .right) + } + + func forEachMenu(_ execute: (Menu) -> Void) { + [menuLeftNavigationController, menuRightNavigationController].forEach { menu in + guard let menu = menu else { return } + execute(menu) + } + } + + func setMenu(from: Menu?, to: Menu?, side: PresentDirection) -> Bool { + guard from != to else { return true } + if let from = from { + if !from.isHidden { + Print.warning(.menuInUse, arguments: side.name, required: true) + return false + } + from.transitioningDelegate = nil + } + setupMenu(forSide: side) + return true + } + + func setupMenu(forSide side: PresentDirection) { + guard let menu = menu(forSide: side) else { return } + + menu.transitioningDelegate = menu + menu.modalPresentationStyle = .custom + menu.leftSide = side == .left + + if menu.transitioningDelegate !== self { + let sideMenuManager = menu.transitioningDelegate.self as? SideMenuManager + Print.warning(.menuAlreadyAssigned, arguments: String(describing: menu.self), side.name, String(describing: sideMenuManager)) + menu.transitioningDelegate = menu + } + + setupSwipeGestures() + + // Ensures minimal lag when revealing the menu for the first time using gestures by loading the view: + let _ = menu.topViewController?.view + + } + + func setupSwipeGestures() { + forEachMenu { + if let swipeToDismissGesture = $0.swipeToDismissGesture, !$0.enableSwipeGestures { + swipeToDismissGesture.view?.removeGestureRecognizer(swipeToDismissGesture) + } else if $0.swipeToDismissGesture == nil && $0.enableSwipeGestures { + $0.swipeToDismissGesture = gestureManager.addDismissPanGesture(to: $0.view) + } + } + } + + @objc func handleNotification(notification: NSNotification) { + guard let activeMenu = activeMenu, activeMenu.presentedViewController == nil else { return } + + switch notification.name { + case UIApplication.didEnterBackgroundNotification: + if activeMenu.dismissWhenBackgrounded { + activeMenu.transitionController?.interactionController?.cancel() + activeMenu.dismiss(animated: false, completion: nil) + } + return + case UIApplication.willChangeStatusBarOrientationNotification: + rotating = true + case UIApplication.didChangeStatusBarOrientationNotification: + rotating = false + case UIApplication.willChangeStatusBarFrameNotification: + if !rotating { + activeMenu.dismiss(animated: true, completion: nil) + } + default: break + } + } + + class var visibleViewController: UIViewController? { + return getVisibleViewController(forViewController: UIApplication.shared.keyWindow?.rootViewController) + } + + class func getVisibleViewController(forViewController: UIViewController?) -> UIViewController? { + if let navigationController = forViewController as? UINavigationController { + return getVisibleViewController(forViewController: navigationController.visibleViewController) + } + if let tabBarController = forViewController as? UITabBarController { + return getVisibleViewController(forViewController: tabBarController.selectedViewController) + } + if let splitViewController = forViewController as? UISplitViewController { + return getVisibleViewController(forViewController: splitViewController.viewControllers.last) + } + if let presentedViewController = forViewController?.presentedViewController { + return getVisibleViewController(forViewController: presentedViewController) + } + + return forViewController + } +} + +//extension SideMenuManager: MenuOptions { +// var allowPushOfSameClassTwice: Bool { +// <#code#> +// } +// +// var alwaysAnimate: Bool { +// <#code#> +// } +// +// var animationOptions: UIView.AnimationOptions { +// <#code#> +// } +// +// var completeGestureDuration: Double { +// <#code#> +// } +// +// var completionCurve: UIView.AnimationCurve { +// <#code#> +// } +// +// var dismissDuration: Double { +// <#code#> +// } +// +// var dismissOnPresent: Bool { +// <#code#> +// } +// +// var dismissOnPush: Bool { +// <#code#> +// } +// +// var dismissWhenBackgrounded: Bool { +// <#code#> +// } +// +// var initialSpringVelocity: CGFloat { +// <#code#> +// } +// +// var presentDuration: Double { +// <#code#> +// } +// +// var presentStyle: MenuPresentStyle { +// <#code#> +// } +// +// var pushStyle: MenuPushStyle { +// <#code#> +// } +// +// var usingSpringWithDamping: CGFloat { +// <#code#> +// } +// +//} + +// Deprecations, to be removed at a future date. +extension SideMenuManager { +// @available(*, deprecated, renamed: "menuPresentStyle") +// open var menuPresentMode: MenuPresentStyle { +// get { return menuPresentStyle } +// set { menuPresentStyle = newValue } +// } +} diff --git a/Pod/Classes/SideMenuPresentationController.swift b/Pod/Classes/SideMenuPresentationController.swift new file mode 100644 index 0000000..831919d --- /dev/null +++ b/Pod/Classes/SideMenuPresentationController.swift @@ -0,0 +1,362 @@ +// +// BasePresentationController.swift +// SideMenu +// +// Created by Jon Kent on 10/20/18. +// + +import UIKit + +public protocol SideMenuPresentationControllerDelegate { + func presentationTransitionWillBegin() + func presentationTransition() + func presentationTransitionDidEnd(_ completed: Bool) + func dismissalTransitionWillBegin() + func dismissalTransition() + func dismissalTransitionDidEnd(_ completed: Bool) +} + +open class MenuPresentStyle: NSObject, SideMenuPresentationControllerDelegate { + + public struct Options { + public var backgroundColor: UIColor? = nil + public var fadeStatusBarStrength: CGFloat = 1 + public var menuFadeStrength: CGFloat = 0 + public var menuOnTop: Bool = false + public var menuTransformTranslateFactor: CGFloat = 0 + public var menuTransformScaleFactor: CGFloat = 1 + public var onTopShadowColor: UIColor = .black + public var onTopShadowRadius: CGFloat = 5 + public var onTopShadowOpacity: Float = 0.5 + public var onTopShadowOffset: CGSize = .zero + public var presentingFadeStrength: CGFloat = 0 + public var presentingTransformTranslateFactor: CGFloat = 0 + public var presentingTransformScaleFactor: CGFloat = 1 + public var presentingParallaxStrength: CGSize = .zero + + public init() {} + } + + public let options: Options + + public init(options: Options) { + self.options = options + } + + public convenience init(_ block: (inout Options) -> Void) { + var options = Options() + block(&options) + self.init(options: options) + } + + // Override with custom behaviors if desired + open func presentationTransitionWillBegin() {} + open func presentationTransition() {} + open func presentationTransitionDidEnd(_ completed: Bool) {} + open func dismissalTransitionWillBegin() {} + open func dismissalTransition() {} + open func dismissalTransitionDidEnd(_ completed: Bool) {} +} + +public extension MenuPresentStyle { + public static let menuSlideIn = MenuPresentStyle { + $0.menuOnTop = true + $0.menuTransformTranslateFactor = -1 + } + public static let viewSlideOut = MenuPresentStyle { + $0.presentingTransformTranslateFactor = 1 + } + public static let viewSlideOutMenuIn = MenuPresentStyle { + $0.menuTransformTranslateFactor = -1 + $0.presentingTransformTranslateFactor = 1 + } + @available(*, deprecated, renamed: "viewSlideOutMenuIn") + public static let viewSlideInOut = viewSlideOutMenuIn + public static let menuDissolveIn = MenuPresentStyle { + $0.menuFadeStrength = 1 + $0.menuOnTop = true + } + public static let viewSlideOutMenuPartialIn = MenuPresentStyle { + $0.menuTransformTranslateFactor = -0.5 + $0.presentingTransformTranslateFactor = 1 + } + public static let viewSlideOutMenuOut = MenuPresentStyle { + $0.menuTransformTranslateFactor = 1 + $0.presentingTransformTranslateFactor = 1 + } + public static let viewSlideOutMenuPartialOut = MenuPresentStyle { + $0.menuTransformTranslateFactor = 0.5 + $0.presentingTransformTranslateFactor = 1 + } + public static let viewSlideOutMenuZoom = MenuPresentStyle { + $0.presentingTransformTranslateFactor = 1 + $0.menuTransformScaleFactor = 0.95 + } +} + +internal class SideMenuPresentationController: SideMenuPresentationControllerDelegate { + + private let style: MenuPresentStyle + private let sideMenuNavigationController: Menu + private let presentingViewController: UIViewController + private let containerView: UIView + private let presentingUserInteractionEnabled: Bool + private var presentingViewControllerUseSnapshot: Bool + + private weak var originalSuperview: UIView? + private var interactivePopGestureRecognizerEnabled: Bool? + private var presented: Bool = false + + private var _tapView: UIView? { + didSet { + oldValue?.removeFromSuperview() + } + } + + internal var tapView: UIView? { + if presentingUserInteractionEnabled { return nil } + var tapView = _tapView + if tapView == nil { + tapView = presentingViewControllerUseSnapshot ? sideMenuNavigationController.view.snapshotView(afterScreenUpdates: true) : UIView() + tapView?.autoresizingMask = [.flexibleHeight, .flexibleWidth] + _tapView = tapView + } + return tapView + } + + private var _statusBarView: UIView? { + didSet { + oldValue?.removeFromSuperview() + } + } + + init(style: MenuPresentStyle, + presented sideMenuNavigationController: Menu, + presenting presentingViewController: UIViewController, + containerView: UIView, + presentingUserInteractionEnabled: Bool, + presentingViewControllerUseSnapshot: Bool) { + self.style = style + self.sideMenuNavigationController = sideMenuNavigationController + self.presentingViewController = presentingViewController + self.containerView = containerView + self.presentingUserInteractionEnabled = presentingUserInteractionEnabled + self.presentingViewControllerUseSnapshot = presentingViewControllerUseSnapshot + } + + deinit { + guard presented else { return } + fatalError("TEMPORARY: Presentation Controller destroyed without reversing presentation!") + } + + open var frameOfPresentedViewInContainerView: CGRect { + var rect = containerView.frame + rect.origin.x = sideMenuNavigationController.leftSide ? 0 : rect.width - menuWidth + rect.size.width = menuWidth + return rect + } + + open func containerViewWillLayoutSubviews() { + sideMenuNavigationController.view.untransform { + sideMenuNavigationController.view.frame = frameOfPresentedViewInContainerView + } + tapView?.frame = presentingViewController.view.bounds + + if let statusBarView = statusBarView { + let statusBarOffset = containerView.frame.size.height - sideMenuNavigationController.view.bounds.height + var statusBarFrame = UIApplication.shared.statusBarFrame + + // For in-call status bar, height is normally 40, which overlaps view. Instead, calculate height difference + // of view and set height to fill in remaining space. + if statusBarOffset >= CGFloat.ulpOfOne { + statusBarFrame.size.height = statusBarOffset + } + + statusBarView.frame = statusBarFrame + } + } + + open func presentationTransitionWillBegin() { + presented = true + + if let backgroundColor = style.options.backgroundColor { + containerView.backgroundColor = backgroundColor + } + + originalSuperview = presentingViewController.view.superview + containerView.addSubview(presentingViewController.view) + containerView.addSubview(sideMenuNavigationController.view) + + layerViews() + + if let statusBarView = statusBarView { + containerView.addSubview(statusBarView) + } + + dismissalTransition() + style.presentationTransitionWillBegin() + } + + open func presentationTransition() { + statusBarView?.alpha = style.options.fadeStatusBarStrength + + transition( + to: sideMenuNavigationController, + from: presentingViewController, + fade: style.options.presentingFadeStrength, + scale: style.options.presentingTransformScaleFactor, + translate: style.options.presentingTransformTranslateFactor + ) + + style.presentationTransition() + } + + open func presentationTransitionDidEnd(_ completed: Bool) { + guard completed else { + dismissalTransitionDidEnd(!completed) + return + } + + addParallax(to: presentingViewController.view) + + if let topNavigationController = presentingViewController as? UINavigationController { + interactivePopGestureRecognizerEnabled = topNavigationController.interactivePopGestureRecognizer?.isEnabled + topNavigationController.interactivePopGestureRecognizer?.isEnabled = false + } + + if let tapView = tapView { + presentingViewController.view.addSubview(tapView) + } + + containerViewWillLayoutSubviews() + style.presentationTransitionDidEnd(completed) + } + + open func dismissalTransitionWillBegin() { + presentationTransition() + style.dismissalTransitionWillBegin() + } + + open func dismissalTransition() { + statusBarView?.alpha = 0 + + transition( + to: presentingViewController, + from: sideMenuNavigationController, + fade: style.options.menuFadeStrength, + scale: style.options.menuTransformScaleFactor, + translate: style.options.menuTransformTranslateFactor + ) + + style.dismissalTransition() + } + + open func dismissalTransitionDidEnd(_ completed: Bool) { + guard completed else { return } + + presented = false + + tapView?.removeFromSuperview() + statusBarView?.removeFromSuperview() + sideMenuNavigationController.view.removeFromSuperview() + + presentingViewController.view.motionEffects.removeAll() + presentingViewController.view.layer.shadowOpacity = 0 + sideMenuNavigationController.view.layer.shadowOpacity = 0 + + if let interactivePopGestureRecognizerEnabled = interactivePopGestureRecognizerEnabled, + let topNavigationController = presentingViewController as? UINavigationController { + topNavigationController.interactivePopGestureRecognizer?.isEnabled = interactivePopGestureRecognizerEnabled + } + + originalSuperview?.addSubview(presentingViewController.view) + + style.dismissalTransitionDidEnd(completed) + } +} + +private extension SideMenuPresentationController { + + private var statusBarView: UIView? { + guard style.options.fadeStatusBarStrength != 0 else { return nil } + var statusBarView = _statusBarView + if statusBarView == nil { + statusBarView = UIView() + statusBarView?.backgroundColor = style.options.backgroundColor ?? .black + statusBarView?.autoresizingMask = [.flexibleHeight, .flexibleWidth] + statusBarView?.isUserInteractionEnabled = false + _statusBarView = statusBarView + } + return statusBarView + } + + var menuWidth: CGFloat { + return sideMenuNavigationController.menuWidth + } + + func transition(to: UIViewController, from: UIViewController, fade: CGFloat, scale: CGFloat, translate: CGFloat) { + containerViewWillLayoutSubviews() + + to.view.transform = .identity + to.view.alpha = 1 + + from.view.alpha = 1 - fade + from.view.transform = CGAffineTransform.identity + .scaledBy( + x: scale, + y: scale + ).translatedBy( + x: (sideMenuNavigationController.leftSide ? 1 : -1) * menuWidth * translate, + y: 0 + ) + } + + func layerViews() { + statusBarView?.layer.zPosition = 2 + + if style.options.menuOnTop { + addShadow(to: sideMenuNavigationController.view) + sideMenuNavigationController.view.bringToFront() + sideMenuNavigationController.view.layer.zPosition = 1 + presentingViewController.view.layer.zPosition = 0 + } else { + addShadow(to: presentingViewController.view) + presentingViewController.view.bringToFront() + presentingViewController.view.layer.zPosition = 1 + sideMenuNavigationController.view.layer.zPosition = 0 + } + } + + func addShadow(to view: UIView) { + view.layer.shadowColor = style.options.onTopShadowColor.cgColor + view.layer.shadowRadius = style.options.onTopShadowRadius + view.layer.shadowOpacity = style.options.onTopShadowOpacity + view.layer.shadowOffset = CGSize(width: 0, height: 0) + } + + func addParallax(to view: UIView) { + var effects: [UIInterpolatingMotionEffect] = [] + + let x = style.options.presentingParallaxStrength.width + if x > 0 { + let horizontal = UIInterpolatingMotionEffect(keyPath: "center.x", type: .tiltAlongHorizontalAxis) + horizontal.minimumRelativeValue = -x + horizontal.maximumRelativeValue = x + effects.append(horizontal) + } + + let y = style.options.presentingParallaxStrength.height + if y > 0 { + let vertical = UIInterpolatingMotionEffect(keyPath: "center.y", type: .tiltAlongVerticalAxis) + vertical.minimumRelativeValue = -y + vertical.maximumRelativeValue = y + effects.append(vertical) + } + + if effects.count > 0 { + let group = UIMotionEffectGroup() + group.motionEffects = effects + view.addMotionEffect(group) + } + } +} diff --git a/Pod/Classes/SideMenuTransition.swift b/Pod/Classes/SideMenuTransition.swift deleted file mode 100644 index caa4498..0000000 --- a/Pod/Classes/SideMenuTransition.swift +++ /dev/null @@ -1,575 +0,0 @@ -// -// SideMenuTransition.swift -// Pods -// -// Created by Jon Kent on 1/14/16. -// -// - -import UIKit - -open class SideMenuTransition: UIPercentDrivenInteractiveTransition { - - fileprivate var presenting = false - fileprivate var interactive = false - fileprivate weak var originalSuperview: UIView? - fileprivate weak var activeGesture: UIGestureRecognizer? - fileprivate var switchMenus = false { - didSet { - if switchMenus { - cancel() - } - } - } - fileprivate var menuWidth: CGFloat { - let overriddenWidth = menuViewController?.menuWidth ?? 0 - if overriddenWidth > CGFloat.ulpOfOne { - return overriddenWidth - } - return sideMenuManager.menuWidth - } - internal weak var sideMenuManager: SideMenuManager! - internal weak var mainViewController: UIViewController? - internal weak var menuViewController: UISideMenuNavigationController? { - return presentDirection == .left ? sideMenuManager.menuLeftNavigationController : sideMenuManager.menuRightNavigationController - } - internal var presentDirection: UIRectEdge = .left - internal weak var tapView: UIView? { - didSet { - guard let tapView = tapView else { - return - } - - tapView.autoresizingMask = [.flexibleHeight, .flexibleWidth] - let exitPanGesture = UIPanGestureRecognizer() - exitPanGesture.addTarget(self, action:#selector(SideMenuTransition.handleHideMenuPan(_:))) - let exitTapGesture = UITapGestureRecognizer() - exitTapGesture.addTarget(self, action: #selector(SideMenuTransition.handleHideMenuTap(_:))) - tapView.addGestureRecognizer(exitPanGesture) - tapView.addGestureRecognizer(exitTapGesture) - } - } - internal weak var statusBarView: UIView? { - didSet { - guard let statusBarView = statusBarView else { - return - } - - statusBarView.backgroundColor = sideMenuManager.menuAnimationBackgroundColor ?? UIColor.black - statusBarView.isUserInteractionEnabled = false - } - } - - required public init(sideMenuManager: SideMenuManager) { - super.init() - - NotificationCenter.default.addObserver(self, selector:#selector(handleNotification), name: UIApplication.didEnterBackgroundNotification, object: nil) - NotificationCenter.default.addObserver(self, selector:#selector(handleNotification), name: UIApplication.willChangeStatusBarFrameNotification, object: nil) - self.sideMenuManager = sideMenuManager - } - - deinit { - NotificationCenter.default.removeObserver(self) - } - - fileprivate static var visibleViewController: UIViewController? { - return getVisibleViewController(forViewController: UIApplication.shared.keyWindow?.rootViewController) - } - - fileprivate class func getVisibleViewController(forViewController: UIViewController?) -> UIViewController? { - if let navigationController = forViewController as? UINavigationController { - return getVisibleViewController(forViewController: navigationController.visibleViewController) - } - if let tabBarController = forViewController as? UITabBarController { - return getVisibleViewController(forViewController: tabBarController.selectedViewController) - } - if let splitViewController = forViewController as? UISplitViewController { - return getVisibleViewController(forViewController: splitViewController.viewControllers.last) - } - if let presentedViewController = forViewController?.presentedViewController { - return getVisibleViewController(forViewController: presentedViewController) - } - - return forViewController - } - - @objc internal func handlePresentMenuLeftScreenEdge(_ edge: UIScreenEdgePanGestureRecognizer) { - presentDirection = .left - handlePresentMenuPan(edge) - } - - @objc internal func handlePresentMenuRightScreenEdge(_ edge: UIScreenEdgePanGestureRecognizer) { - presentDirection = .right - handlePresentMenuPan(edge) - } - - @objc internal func handlePresentMenuPan(_ pan: UIPanGestureRecognizer) { - if activeGesture == nil { - activeGesture = pan - } else if pan != activeGesture { - 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? - guard let view = mainViewController?.view ?? pan.view else { - return - } - - let transform = view.transform - view.transform = .identity - let translation = pan.translation(in: pan.view!) - view.transform = transform - - // do some math to translate this to a percentage based value - if !interactive { - if translation.x == 0 { - return // not sure which way the user is swiping yet, so do nothing - } - - if !(pan is UIScreenEdgePanGestureRecognizer) { - presentDirection = translation.x > 0 ? .left : .right - } - - if let menuViewController = menuViewController, let visibleViewController = SideMenuTransition.visibleViewController { - interactive = true - visibleViewController.present(menuViewController, animated: true, completion: nil) - } else { - return - } - } - - let direction: CGFloat = presentDirection == .left ? 1 : -1 - let distance = translation.x / menuWidth - // now lets deal with different states that the gesture recognizer sends - switch (pan.state) { - case .began, .changed: - if pan is UIScreenEdgePanGestureRecognizer { - update(min(distance * direction, 1)) - } else if distance > 0 && presentDirection == .right && sideMenuManager.menuLeftNavigationController != nil { - presentDirection = .left - switchMenus = true - } else if distance < 0 && presentDirection == .left && sideMenuManager.menuRightNavigationController != nil { - presentDirection = .right - switchMenus = true - } else { - update(min(distance * direction, 1)) - } - default: - interactive = false - view.transform = .identity - let velocity = pan.velocity(in: pan.view!).x * direction - view.transform = transform - if velocity >= 100 || velocity >= -50 && abs(distance) >= 0.5 { - finish() - } else { - cancel() - } - } - } - - @objc internal func handleHideMenuPan(_ pan: UIPanGestureRecognizer) { - if activeGesture == nil { - activeGesture = pan - } else if pan != activeGesture { - pan.isEnabled = false - pan.isEnabled = true - return - } - - let translation = pan.translation(in: pan.view!) - let direction:CGFloat = presentDirection == .left ? -1 : 1 - let distance = translation.x / menuWidth * direction - - switch (pan.state) { - - case .began: - interactive = true - mainViewController?.dismiss(animated: true, completion: nil) - case .changed: - update(max(min(distance, 1), 0)) - default: - interactive = false - let velocity = pan.velocity(in: pan.view!).x * direction - if velocity >= 100 || velocity >= -50 && distance >= 0.5 { - finish() - activeGesture = nil - } else { - cancel() - activeGesture = nil - } - } - } - - @objc internal func handleHideMenuTap(_ tap: UITapGestureRecognizer) { - menuViewController?.dismiss(animated: true, completion: nil) - } - - @discardableResult internal func hideMenuStart() -> SideMenuTransition { - guard let menuView = menuViewController?.view, - let mainView = mainViewController?.view else { - return self - } - - mainView.transform = .identity - mainView.alpha = 1 - mainView.frame.origin = .zero - menuView.transform = .identity - menuView.frame.origin.y = 0 - menuView.frame.size.width = menuWidth - menuView.frame.size.height = mainView.frame.height // in case status bar height changed - var statusBarFrame = UIApplication.shared.statusBarFrame - let statusBarOffset = SideMenuManager.appScreenRect.size.height - mainView.frame.maxY - // For in-call status bar, height is normally 40, which overlaps view. Instead, calculate height difference - // of view and set height to fill in remaining space. - if statusBarOffset >= CGFloat.ulpOfOne { - statusBarFrame.size.height = statusBarOffset - } - statusBarView?.frame = statusBarFrame - statusBarView?.alpha = 0 - - switch sideMenuManager.menuPresentMode { - - case .viewSlideOut: - menuView.alpha = 1 - sideMenuManager.menuAnimationFadeStrength - menuView.frame.origin.x = presentDirection == .left ? 0 : mainView.frame.width - menuWidth - menuView.transform = CGAffineTransform(scaleX: sideMenuManager.menuAnimationTransformScaleFactor, y: sideMenuManager.menuAnimationTransformScaleFactor) - - case .viewSlideInOut, .menuSlideIn: - menuView.alpha = 1 - menuView.frame.origin.x = presentDirection == .left ? -menuWidth : mainView.frame.width - - case .menuDissolveIn: - menuView.alpha = 0 - menuView.frame.origin.x = presentDirection == .left ? 0 : mainView.frame.width - menuWidth - } - - return self - } - - @discardableResult internal func hideMenuComplete() -> SideMenuTransition { - let menuView = menuViewController?.view - let mainView = mainViewController?.view - - tapView?.removeFromSuperview() - statusBarView?.removeFromSuperview() - mainView?.motionEffects.removeAll() - mainView?.layer.shadowOpacity = 0 - menuView?.layer.shadowOpacity = 0 - if let topNavigationController = mainViewController as? UINavigationController { - topNavigationController.interactivePopGestureRecognizer!.isEnabled = true - } - if let originalSuperview = originalSuperview, let mainView = mainViewController?.view { - originalSuperview.addSubview(mainView) - let y = originalSuperview.bounds.height - mainView.frame.size.height - mainView.frame.origin.y = max(y, 0) - } - - originalSuperview = nil - mainViewController = nil - - return self - } - - @discardableResult internal func presentMenuStart() -> SideMenuTransition { - guard let menuView = menuViewController?.view, - let mainView = mainViewController?.view else { - return self - } - - menuView.alpha = 1 - menuView.transform = .identity - menuView.frame.size.width = menuWidth - let size = SideMenuManager.appScreenRect.size - menuView.frame.origin.x = presentDirection == .left ? 0 : size.width - menuWidth - mainView.transform = .identity - mainView.frame.size.width = size.width - let statusBarOffset = size.height - menuView.bounds.height - mainView.bounds.size.height = size.height - max(statusBarOffset, 0) - mainView.frame.origin.y = 0 - var statusBarFrame = UIApplication.shared.statusBarFrame - // For in-call status bar, height is normally 40, which overlaps view. Instead, calculate height difference - // of view and set height to fill in remaining space. - if statusBarOffset >= CGFloat.ulpOfOne { - statusBarFrame.size.height = statusBarOffset - } - tapView?.transform = .identity - tapView?.bounds = mainView.bounds - statusBarView?.frame = statusBarFrame - statusBarView?.alpha = 1 - - switch sideMenuManager.menuPresentMode { - - case .viewSlideOut, .viewSlideInOut: - mainView.layer.shadowColor = sideMenuManager.menuShadowColor.cgColor - mainView.layer.shadowRadius = sideMenuManager.menuShadowRadius - mainView.layer.shadowOpacity = sideMenuManager.menuShadowOpacity - mainView.layer.shadowOffset = CGSize(width: 0, height: 0) - let direction:CGFloat = presentDirection == .left ? 1 : -1 - mainView.frame.origin.x = direction * menuView.frame.width - - case .menuSlideIn, .menuDissolveIn: - if sideMenuManager.menuBlurEffectStyle == nil { - menuView.layer.shadowColor = sideMenuManager.menuShadowColor.cgColor - menuView.layer.shadowRadius = sideMenuManager.menuShadowRadius - menuView.layer.shadowOpacity = sideMenuManager.menuShadowOpacity - menuView.layer.shadowOffset = CGSize(width: 0, height: 0) - } - mainView.frame.origin.x = 0 - } - - if sideMenuManager.menuPresentMode != .viewSlideOut { - mainView.transform = CGAffineTransform(scaleX: sideMenuManager.menuAnimationTransformScaleFactor, y: sideMenuManager.menuAnimationTransformScaleFactor) - if sideMenuManager.menuAnimationTransformScaleFactor > 1 { - tapView?.transform = mainView.transform - } - mainView.alpha = 1 - sideMenuManager.menuAnimationFadeStrength - } - - return self - } - - @discardableResult internal func presentMenuComplete() -> SideMenuTransition { - switch sideMenuManager.menuPresentMode { - case .menuSlideIn, .menuDissolveIn, .viewSlideInOut: - if let mainView = mainViewController?.view, sideMenuManager.menuParallaxStrength != 0 { - let horizontal = UIInterpolatingMotionEffect(keyPath: "center.x", type: .tiltAlongHorizontalAxis) - horizontal.minimumRelativeValue = -sideMenuManager.menuParallaxStrength - horizontal.maximumRelativeValue = sideMenuManager.menuParallaxStrength - - let vertical = UIInterpolatingMotionEffect(keyPath: "center.y", type: .tiltAlongVerticalAxis) - vertical.minimumRelativeValue = -sideMenuManager.menuParallaxStrength - vertical.maximumRelativeValue = sideMenuManager.menuParallaxStrength - - let group = UIMotionEffectGroup() - group.motionEffects = [horizontal, vertical] - mainView.addMotionEffect(group) - } - case .viewSlideOut: break; - } - if let topNavigationController = mainViewController as? UINavigationController { - topNavigationController.interactivePopGestureRecognizer!.isEnabled = false - } - - return self - } - - @objc internal func handleNotification(notification: NSNotification) { - guard menuViewController?.presentedViewController == nil && - menuViewController?.presentingViewController != nil else { - return - } - - if let originalSuperview = originalSuperview, - let mainViewController = mainViewController, - sideMenuManager.menuDismissWhenBackgrounded { - originalSuperview.addSubview(mainViewController.view) - } - - if notification.name == UIApplication.didEnterBackgroundNotification { - if sideMenuManager.menuDismissWhenBackgrounded { - hideMenuStart().hideMenuComplete() - menuViewController?.dismiss(animated: false, completion: nil) - } - return - } - - UIView.animate(withDuration: sideMenuManager.menuAnimationDismissDuration, - delay: 0, - usingSpringWithDamping: sideMenuManager.menuAnimationUsingSpringWithDamping, - initialSpringVelocity: sideMenuManager.menuAnimationInitialSpringVelocity, - options: sideMenuManager.menuAnimationOptions, - animations: { - self.hideMenuStart() - }) { (finished) -> Void in - self.hideMenuComplete() - self.menuViewController?.dismiss(animated: false, completion: nil) - } - } - -} - -extension SideMenuTransition: UIViewControllerAnimatedTransitioning { - - // animate a change from one viewcontroller to another - open func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { - - completionCurve = sideMenuManager.menuAnimationCompletionCurve - - // get reference to our fromView, toView and the container view that we should perform the transition in - let container = transitionContext.containerView - // prevent any other menu gestures from firing - container.isUserInteractionEnabled = false - - if let menuBackgroundColor = sideMenuManager.menuAnimationBackgroundColor { - container.backgroundColor = menuBackgroundColor - } - - let fromViewController = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.from)! - let toViewController = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to)! - - // assign references to our menu view controller and the 'bottom' view controller from the tuple - // remember that our menuViewController will alternate between the from and to view controller depending if we're presenting or dismissing - mainViewController = presenting ? fromViewController : toViewController - - let menuView = menuViewController!.view! - let topView = mainViewController!.view! - - // prepare menu items to slide in - if presenting { - originalSuperview = topView.superview - - // add the both views to our view controller - switch sideMenuManager.menuPresentMode { - case .viewSlideOut, .viewSlideInOut: - container.addSubview(menuView) - container.addSubview(topView) - case .menuSlideIn, .menuDissolveIn: - container.addSubview(topView) - container.addSubview(menuView) - } - - if sideMenuManager.menuFadeStatusBar { - let statusBarView = UIView() - self.statusBarView = statusBarView - container.addSubview(statusBarView) - } - - hideMenuStart() - } - - let animate = { - if self.presenting { - self.presentMenuStart() - } else { - self.hideMenuStart() - } - } - - let complete = { - container.isUserInteractionEnabled = true - - // tell our transitionContext object that we've finished animating - if transitionContext.transitionWasCancelled { - let viewControllerForPresentedMenu = self.mainViewController - - if self.presenting { - self.hideMenuComplete() - } else { - self.presentMenuComplete() - } - - transitionContext.completeTransition(false) - - if self.switchMenus { - self.switchMenus = false - viewControllerForPresentedMenu?.present(self.menuViewController!, animated: true, completion: nil) - } - - return - } - - if self.presenting { - self.presentMenuComplete() - transitionContext.completeTransition(true) - switch self.sideMenuManager.menuPresentMode { - case .viewSlideOut, .viewSlideInOut: - container.addSubview(topView) - case .menuSlideIn, .menuDissolveIn: - container.insertSubview(topView, at: 0) - } - if !self.sideMenuManager.menuPresentingViewControllerUserInteractionEnabled { - let tapView = UIView() - container.insertSubview(tapView, aboveSubview: topView) - tapView.bounds = container.bounds - tapView.center = topView.center - if self.sideMenuManager.menuAnimationTransformScaleFactor > 1 { - tapView.transform = topView.transform - } - self.tapView = tapView - } - if let statusBarView = self.statusBarView { - container.bringSubviewToFront(statusBarView) - } - - return - } - - self.hideMenuComplete() - transitionContext.completeTransition(true) - menuView.removeFromSuperview() - } - - // perform the animation! - let duration = transitionDuration(using: transitionContext) - if interactive { - UIView.animate(withDuration: duration, - delay: duration, // HACK: If zero, the animation briefly flashes in iOS 11. - options: .curveLinear, - animations: { - animate() - }, completion: { (finished) in - complete() - }) - } else { - UIView.animate(withDuration: duration, - delay: 0, - usingSpringWithDamping: sideMenuManager.menuAnimationUsingSpringWithDamping, - initialSpringVelocity: sideMenuManager.menuAnimationInitialSpringVelocity, - options: sideMenuManager.menuAnimationOptions, - animations: { - animate() - }) { (finished) -> Void in - complete() - } - } - } - - // return how many seconds the transiton animation will take - open func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { - if interactive { - return sideMenuManager.menuAnimationCompleteGestureDuration - } - return presenting ? sideMenuManager.menuAnimationPresentDuration : sideMenuManager.menuAnimationDismissDuration - } - - open override func update(_ percentComplete: CGFloat) { - guard !switchMenus else { - return - } - - super.update(percentComplete) - } - -} - -extension SideMenuTransition: UIViewControllerTransitioningDelegate { - - // return the animator when presenting a viewcontroller - // rememeber that an animator (or animation controller) is any object that aheres to the UIViewControllerAnimatedTransitioning protocol - open func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { - self.presenting = true - presentDirection = presented == sideMenuManager.menuLeftNavigationController ? .left : .right - return self - } - - // return the animator used when dismissing from a viewcontroller - open func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { - presenting = false - return self - } - - open func interactionControllerForPresentation(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? { - // if our interactive flag is true, return the transition manager object - // otherwise return nil - return interactive ? self : nil - } - - open func interactionControllerForDismissal(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? { - return interactive ? self : nil - } - -} diff --git a/Pod/Classes/SideMenuTransitionController.swift b/Pod/Classes/SideMenuTransitionController.swift new file mode 100644 index 0000000..4683216 --- /dev/null +++ b/Pod/Classes/SideMenuTransitionController.swift @@ -0,0 +1,307 @@ +// +// SideMenuAnimationController.swift +// SideMenu +// +// Created by Jon Kent on 10/24/18. +// + +import UIKit + +internal protocol SideMenuTransitionControllerDelegate: class { + func sideMenuTransitionController(_ transitionController: SideMenuTransitionController, animationEnded transitionCompleted: Bool) +} + +internal class SideMenuTransitionController: NSObject, UIViewControllerAnimatedTransitioning { + + internal weak var tapView: UIView? + internal var interactive: Bool = false + internal var options: Menu.Options + internal var delegate: SideMenuTransitionControllerDelegate? + internal lazy var interactionController: SideMenuInteractionController? = { + guard interactive else { return nil } + return SideMenuInteractionController(completionCurve: options.completionCurve) + }() + + private(set) var presenting: Bool = true + private var transitioning = false + private weak var containerView: UIView? + private var presentationController: SideMenuPresentationController! + + init(options: Menu.Options) { + self.options = options + } + + deinit { + guard !presenting else { return } + fatalError("TEMPORARY: Transition controller destroyed without reversing presentation!") + } + + open func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { + guard + let toViewController = transitionContext.viewController(forKey: .to), + let fromViewController = transitionContext.viewController(forKey: .from), + let menu = (toViewController as? Menu) ?? (fromViewController as? Menu) + else { return } + + menu.sideMenuManagerDelegate = self + options = menu.options + let presentingViewController = menu == toViewController ? fromViewController : toViewController + containerView = transitionContext.containerView + + if presenting { + presentationController = SideMenuPresentationController(style: options.presentStyle, + presented: menu, + presenting: presentingViewController, + containerView: transitionContext.containerView, + presentingUserInteractionEnabled: options.presentingViewControllerUserInteractionEnabled, + presentingViewControllerUseSnapshot: options.presentingViewControllerUseSnapshot) + } + + transition(using: transitionContext) + } + + open func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { + return duration + } + + open func animationEnded(_ transitionCompleted: Bool) { + transitioning = false + interactive = false + delegate?.sideMenuTransitionController(self, animationEnded: transitionCompleted) + if transitionCompleted { + presenting = !presenting + } + } +} + +extension SideMenuTransitionController: UISideMenuNavigationControllerManagerDelegate { + + internal func sideMenuWillAppear(menu: Menu, animated: Bool) -> Bool { + // Dismiss keyboard to prevent weird keyboard animations from occurring during transition + menu.presentingViewController?.view.endEditing(true) + return true + } + + internal func sideMenuDidAppear(menu: Menu, animated: Bool) -> Bool { + // We had presented a view before, so lets dismiss ourselves as already acted upon + if menu.view.isHidden { + presentationController.dismissalTransitionDidEnd(true) + presenting = true + menu.dismiss(animated: false, completion: { + menu.view.isHidden = false + }) + } else if menu.topViewController == nil { + Print.warning(.emptyMenu) + } + + return true + } + + internal func sideMenuWillDisappear(menu: Menu, animated: Bool) -> Bool { + // 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 menu.dismissOnPresent && !menu.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 = menu.presentingViewController?.view, let containerView = presentingView.superview { + containerView.addSubview(menu.view) + } + + animate(animated: animated, animations: { [weak self] in + self?.presentationController.dismissalTransition() + menu.activeDelegate?.sideMenuWillDisappear?(menu: menu, animated: animated) + }) { completed in + menu.activeDelegate?.sideMenuDidDisappear?(menu: menu, animated: animated) + menu.view.isHidden = true + } + return true + } + + return true + } + + internal func sideMenuDidDisappear(menu: Menu, animated: Bool) -> Bool { + // Work-around: if the menu is dismissed without animation the transition logic is never called to restore the + // 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 let activeDelegate = menu.activeDelegate as? UIViewController, activeDelegate.view.window == nil { + presentationController?.dismissalTransition() + } + + // Clear selecton on UITableViewControllers when reappearing using custom transitions + if let tableViewController = menu.topViewController as? UITableViewController, + let tableView = tableViewController.tableView, + let indexPaths = tableView.indexPathsForSelectedRows, + tableViewController.clearsSelectionOnViewWillAppear { + indexPaths.forEach { tableView.deselectRow(at: $0, animated: false) } + } + + return true + } + + internal func sideMenuShouldPushViewController(menu: Menu, viewController: UIViewController, animated: Bool, completion: ((Bool) -> Void)?) -> Bool { + guard menu.viewControllers.count > 0 && menu.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 = menu.presentingViewController as? UISplitViewController + let tabBarController = menu.presentingViewController as? UITabBarController + let potentialNavigationController = (splitViewController?.viewControllers.first ?? tabBarController?.selectedViewController) ?? menu.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 menu.dismissOnPush { + let animated = animated || menu.alwaysAnimate + + CATransaction.setCompletionBlock { [weak self] in + menu.activeDelegate?.sideMenuDidDisappear?(menu: menu, animated: animated) + self?.presenting = true + menu.dismiss(animated: false, completion: nil) + completion?(push) + } + + if animated { + let areAnimationsEnabled = UIView.areAnimationsEnabled + UIView.setAnimationsEnabled(true) + transition(animated: animated, alongsideTransition: { + menu.activeDelegate?.sideMenuWillDisappear?(menu: menu, animated: animated) + }) + UIView.setAnimationsEnabled(areAnimationsEnabled) + } + } + + if let lastViewController = navigationController.viewControllers.last, + !menu.allowPushOfSameClassTwice && type(of: lastViewController) == type(of: viewController) { + return false + } + + switch menu.pushStyle { + case .subMenu: return false // handled earlier + case .defaultBehavior: + 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 menu.pushStyle == .preserveAndHideBackButton { + preservedViewController.navigationItem.hidesBackButton = true + } + viewControllers.append(preservedViewController) + navigationController.setViewControllers(viewControllers, animated: animated) + return false + } + if menu.pushStyle == .preserveAndHideBackButton { + viewController.navigationItem.hidesBackButton = true + } + + push = true + return true + case .replace: + viewController.navigationItem.hidesBackButton = true + navigationController.setViewControllers([viewController], animated: animated) + return false + } + } + + internal func sideMenuWillTransition(menu: Menu, to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { + // Don't bother resizing if the view isn't visible + guard let presentationController = presentationController, !menu.view.isHidden else { return } + + coordinator.animate(alongsideTransition: { (context) in + presentationController.presentationTransition() + }, completion: nil) + } +} + +private extension SideMenuTransitionController { + + var duration: Double { + if interactive { return options.completeGestureDuration } + return presenting ? options.presentDuration : options.dismissDuration + } + + func transition(animated: Bool = true, alongsideTransition: (() -> Void)? = nil, completion: ((Bool) -> Void)? = nil, using transitionContext: UIViewControllerContextTransitioning? = nil) { + let presentationController: SideMenuPresentationController! = self.presentationController + let presenting = self.presenting + + transitioning = true + + // prevent any other menu gestures from firing + containerView?.isUserInteractionEnabled = false + + if presenting { + presentationController.presentationTransitionWillBegin() + } else { + presentationController.dismissalTransitionWillBegin() + } + + let animations = { + if presenting { + presentationController.presentationTransition() + } else { + presentationController.dismissalTransition() + } + alongsideTransition?() + } + + let completion: (Bool) -> Void = { [weak self] _ in + self?.containerView?.isUserInteractionEnabled = true + let completed = !(transitionContext?.transitionWasCancelled ?? false) + if presenting { + presentationController.presentationTransitionDidEnd(completed) + self?.tapView = presentationController.tapView + } else { + presentationController.dismissalTransitionDidEnd(completed) + } + completion?(completed) + transitionContext?.completeTransition(completed) + } + + animate(animated: animated, animations: animations, completion: completion) + } + + func animate(animated: Bool = true, animations: @escaping () -> Void, completion: ((Bool) -> Void)? = nil) { + if interactive { + // IMPORTANT: The non-interactive animation block will not complete if adapted for interactive. The below animation block must be used! + UIView.animate( + withDuration: self.duration, + delay: self.duration, // HACK: If zero, the animation briefly flashes in iOS 11. + options: .curveLinear, + animations: animations, + completion: completion + ) + } else { + let duration = animated ? self.duration : 0 + UIView.animate( + withDuration: duration, + delay: 0, + usingSpringWithDamping: options.usingSpringWithDamping, + initialSpringVelocity: options.initialSpringVelocity, + options: options.animationOptions, + animations: animations, + completion: completion + ) + } + } +} diff --git a/Pod/Classes/UISideMenuNavigationController.swift b/Pod/Classes/UISideMenuNavigationController.swift index 1a2ee47..20257ea 100644 --- a/Pod/Classes/UISideMenuNavigationController.swift +++ b/Pod/Classes/UISideMenuNavigationController.swift @@ -7,6 +7,37 @@ import UIKit +@objc public enum MenuPushStyle: Int { + case defaultBehavior, + popWhenPossible, + replace, + preserve, + preserveAndHideBackButton, + subMenu +} + +internal protocol MenuOptions { + var allowPushOfSameClassTwice: Bool { get } + var alwaysAnimate: Bool { get } + var animationOptions: UIView.AnimationOptions { get } + var blurEffectStyle: UIBlurEffect.Style? { get } + var completeGestureDuration: Double { get } + var completionCurve: UIView.AnimationCurve { get } + var dismissDuration: Double { get } + var dismissOnPresent: Bool { get } + var dismissOnPush: Bool { get } + var dismissWhenBackgrounded: Bool { get } + var enableSwipeGestures: Bool { get } + var initialSpringVelocity: CGFloat { get } + var presentingViewControllerUserInteractionEnabled: Bool { get } + var presentingViewControllerUseSnapshot: Bool { get } // TODO + var presentDuration: Double { get } + var presentStyle: MenuPresentStyle { get } + var pushStyle: MenuPushStyle { get } + var usingSpringWithDamping: CGFloat { get } + var menuWidth: CGFloat { get } +} + @objc public protocol UISideMenuNavigationControllerDelegate { @objc optional func sideMenuWillAppear(menu: UISideMenuNavigationController, animated: Bool) @objc optional func sideMenuDidAppear(menu: UISideMenuNavigationController, animated: Bool) @@ -14,74 +45,75 @@ import UIKit @objc optional func sideMenuDidDisappear(menu: UISideMenuNavigationController, animated: Bool) } +internal protocol UISideMenuNavigationControllerManagerDelegate: UISideMenuNavigationControllerDelegate { + func sideMenuWillAppear(menu: UISideMenuNavigationController, animated: Bool) -> Bool + func sideMenuDidAppear(menu: UISideMenuNavigationController, animated: Bool) -> Bool + func sideMenuWillDisappear(menu: UISideMenuNavigationController, animated: Bool) -> Bool + func sideMenuDidDisappear(menu: UISideMenuNavigationController, animated: Bool) -> Bool + func sideMenuWillTransition(menu: Menu, to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) + func sideMenuShouldPushViewController(menu: Menu, viewController: UIViewController, animated: Bool, completion: ((Bool) -> Void)?) -> Bool +} + +internal typealias Menu = UISideMenuNavigationController + @objcMembers open class UISideMenuNavigationController: UINavigationController { - - fileprivate weak var foundDelegate: UISideMenuNavigationControllerDelegate? - fileprivate weak var activeDelegate: UISideMenuNavigationControllerDelegate? { - guard !view.isHidden else { - return nil - } - - return sideMenuDelegate ?? foundDelegate ?? findDelegate(forViewController: presentingViewController) + + private enum PropertyName: String { case + leftSide } - fileprivate func findDelegate(forViewController: UIViewController?) -> UISideMenuNavigationControllerDelegate? { - if let navigationController = forViewController as? UINavigationController { - return findDelegate(forViewController: navigationController.topViewController) - } - if let tabBarController = forViewController as? UITabBarController { - return findDelegate(forViewController: tabBarController.selectedViewController) - } - if let splitViewController = forViewController as? UISplitViewController { - return findDelegate(forViewController: splitViewController.viewControllers.last) - } - - foundDelegate = forViewController as? UISideMenuNavigationControllerDelegate - return foundDelegate + + public struct Options: MenuOptions { + var allowPushOfSameClassTwice: Bool = true + var alwaysAnimate: Bool = true + var animationOptions: UIView.AnimationOptions = .curveEaseInOut + var blurEffectStyle: UIBlurEffect.Style? = nil + var completeGestureDuration: Double = 0.35 + var completionCurve: UIView.AnimationCurve = .easeIn + var dismissDuration: Double = 0.35 + var dismissOnPresent: Bool = true + var dismissOnPush: Bool = true + var dismissWhenBackgrounded: Bool = true + var enableSwipeGestures: Bool = true + var initialSpringVelocity: CGFloat = 1 + var presentingViewControllerUserInteractionEnabled: Bool = false + var presentingViewControllerUseSnapshot: Bool = false + var presentDuration: Double = 0.35 + var presentStyle: MenuPresentStyle = .viewSlideOut + var pushStyle: MenuPushStyle = .defaultBehavior + var usingSpringWithDamping: CGFloat = 1 + var menuWidth: CGFloat = { + let appScreenRect = UIApplication.shared.keyWindow?.bounds ?? UIWindow().bounds + let minimumSize = min(appScreenRect.width, appScreenRect.height) + return min(round(minimumSize * 0.75), 240) + }() } - fileprivate var usingInterfaceBuilder = false - internal var locked = false - internal var originalMenuBackgroundColor: UIColor? - internal var transition: SideMenuTransition { - return sideMenuManager.transition + + open var options = Options() { + didSet { + if options.blurEffectStyle != oldValue.blurEffectStyle && isViewLoaded { + setupBlur() + } + } } - + /// Delegate for receiving appear and disappear related events. If `nil` the visible view controller that displays a `UISideMenuNavigationController` automatically receives these events. open weak var sideMenuDelegate: UISideMenuNavigationControllerDelegate? - - /// SideMenuManager instance associated with this menu. Default is `SideMenuManager.default`. This property cannot be changed after the menu has loaded. - open weak var sideMenuManager: SideMenuManager! = SideMenuManager.default { - didSet { - if locked && oldValue != nil { - print("SideMenu Warning: a menu's sideMenuManager property cannot be changed after it has loaded.") - sideMenuManager = oldValue - } - } - } - - /// 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. This property cannot be changed while the isHidden property is false. - @IBInspectable open var menuWidth: CGFloat = 0 { - didSet { - if !isHidden && oldValue != menuWidth { - print("SideMenu Warning: a menu's width property can only be changed when it is hidden.") - menuWidth = oldValue - } - } - } - - /// 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. - @IBInspectable open var leftSide: Bool = false { - didSet { - if locked && leftSide != oldValue { - print("SideMenu Warning: a menu's leftSide property cannot be changed after it has loaded.") - leftSide = oldValue - } - } - } - - /// Indicates if the menu is anywhere in the view hierarchy, even if covered by another view controller. - open var isHidden: Bool { - return presentingViewController == nil + + /// The swipe to dismiss gesture. + open internal(set) weak var swipeToDismissGesture: UIPanGestureRecognizer? = nil + + internal weak var sideMenuManagerDelegate: UISideMenuNavigationControllerManagerDelegate? + internal var originalBackgroundColor: UIColor? + internal var transitionController: SideMenuTransitionController? + + private weak var foundDelegate: UISideMenuNavigationControllerDelegate? + private var _options: Options? + private lazy var _leftSide = Protected(false, if: condition, else: { _ in Menu.elseCondition(.leftSide) } ) + + open var sideMenuManager: SideMenuManager { + get { return transitioningDelegate as? SideMenuManager ?? SideMenuManager.default } +// set { transitioningDelegate = newValue } } #if !STFU_SIDEMENU @@ -108,230 +140,315 @@ open class UISideMenuNavigationController: UINavigationController { open override func awakeFromNib() { super.awakeFromNib() - - usingInterfaceBuilder = true - } - - override open func viewDidLoad() { - super.viewDidLoad() - - if !locked && usingInterfaceBuilder { - if leftSide { - sideMenuManager.menuLeftNavigationController = self - } else { - sideMenuManager.menuRightNavigationController = self - } - } + sideMenuManager.setMenu(self, forLeftSide: leftSide) + setupBlur() } open override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - - // Dismiss keyboard to prevent weird keyboard animations from occurring during transition - presentingViewController?.view.endEditing(true) - + setupBlur() + + guard sideMenuManagerDelegate?.sideMenuWillAppear(menu: self, animated: true) == true else { return } foundDelegate = nil activeDelegate?.sideMenuWillAppear?(menu: self, animated: animated) } override open func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - - // We had presented a view before, so lets dismiss ourselves as already acted upon - if view.isHidden { - transition.hideMenuComplete() - dismiss(animated: false, completion: { () -> Void in - self.view.isHidden = false - }) - - return - } - + + guard sideMenuManagerDelegate?.sideMenuDidAppear(menu: self, animated: animated) == true else { return } activeDelegate?.sideMenuDidAppear?(menu: self, animated: animated) - - #if !STFU_SIDEMENU - if topViewController == nil { - print("SideMenu Warning: the menu doesn't have a view controller to show! UISideMenuNavigationController needs a view controller to display just like a UINavigationController.") - } - #endif } override open func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) - - // 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 !isBeingDismissed { - guard let sideMenuManager = sideMenuManager else { - return - } - - if let mainView = transition.mainViewController?.view { - switch sideMenuManager.menuPresentMode { - case .viewSlideOut, .viewSlideInOut: - mainView.superview?.insertSubview(view, belowSubview: mainView) - case .menuSlideIn, .menuDissolveIn: - if let tapView = transition.tapView { - mainView.superview?.insertSubview(view, aboveSubview: tapView) - } else { - mainView.superview?.insertSubview(view, aboveSubview: mainView) - } - } - } - - // 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: animated ? sideMenuManager.menuAnimationDismissDuration : 0, - delay: 0, - usingSpringWithDamping: sideMenuManager.menuAnimationUsingSpringWithDamping, - initialSpringVelocity: sideMenuManager.menuAnimationInitialSpringVelocity, - options: sideMenuManager.menuAnimationOptions, - animations: { - self.transition.hideMenuStart() - self.activeDelegate?.sideMenuWillDisappear?(menu: self, animated: animated) - }) { (finished) -> Void in - self.activeDelegate?.sideMenuDidDisappear?(menu: self, animated: animated) - self.view.isHidden = true - } - - return - } - + + guard sideMenuManagerDelegate?.sideMenuWillDisappear(menu: self, animated: animated) == true else { return } activeDelegate?.sideMenuWillDisappear?(menu: self, animated: animated) } override open func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) - - // Work-around: if the menu is dismissed without animation the transition logic is never called to restore the - // 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 let sideMenuDelegate = activeDelegate as? UIViewController, sideMenuDelegate.view.window == nil { - transition.hideMenuStart().hideMenuComplete() - } - + + guard sideMenuManagerDelegate?.sideMenuDidDisappear(menu: self, animated: animated) == true else { return } activeDelegate?.sideMenuDidDisappear?(menu: self, animated: animated) - - // Clear selecton on UITableViewControllers when reappearing using custom transitions - guard let tableViewController = topViewController as? UITableViewController, - let tableView = tableViewController.tableView, - let indexPaths = tableView.indexPathsForSelectedRows, - tableViewController.clearsSelectionOnViewWillAppear else { - return - } - - for indexPath in indexPaths { - tableView.deselectRow(at: indexPath, animated: false) - } } override open func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) - // Don't bother resizing if the view isn't visible - guard !view.isHidden else { - return - } - - NotificationCenter.default.removeObserver(self.transition, name: UIApplication.willChangeStatusBarFrameNotification, object: nil) - coordinator.animate(alongsideTransition: { (context) in - self.transition.presentMenuStart() - }) { (context) in - NotificationCenter.default.addObserver(self.transition, selector:#selector(SideMenuTransition.handleNotification), name: UIApplication.willChangeStatusBarFrameNotification, object: nil) - } + sideMenuManagerDelegate?.sideMenuWillTransition(menu: self, to: size, with: coordinator) } override open func pushViewController(_ viewController: UIViewController, animated: Bool) { - guard let sideMenuManager = sideMenuManager, viewControllers.count > 0 && sideMenuManager.menuPushStyle != .subMenu else { - // NOTE: pushViewController is called by init(rootViewController: UIViewController) - // so we must perform the normal super method in this case. + let push = sideMenuManagerDelegate?.sideMenuShouldPushViewController(menu: self, viewController: viewController, animated: animated) { [weak self] _ in + self?.foundDelegate = nil + } ?? true + + if push { super.pushViewController(viewController, animated: animated) - return } - - 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("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 - } - - let activeDelegate = self.activeDelegate - foundDelegate = nil - - // To avoid overlapping dismiss & pop/push calls, create a transaction block where the menu - // is dismissed after showing the appropriate screen - CATransaction.begin() - if sideMenuManager.menuDismissOnPush { - let animated = animated || sideMenuManager.menuAlwaysAnimate - - CATransaction.setCompletionBlock( { () -> Void in - activeDelegate?.sideMenuDidDisappear?(menu: self, animated: animated) - if !animated { - self.transition.hideMenuStart().hideMenuComplete() - } - self.dismiss(animated: animated, completion: nil) - }) - - if animated { - let areAnimationsEnabled = UIView.areAnimationsEnabled - UIView.setAnimationsEnabled(true) - UIView.animate(withDuration: sideMenuManager.menuAnimationDismissDuration, - delay: 0, - usingSpringWithDamping: sideMenuManager.menuAnimationUsingSpringWithDamping, - initialSpringVelocity: sideMenuManager.menuAnimationInitialSpringVelocity, - options: sideMenuManager.menuAnimationOptions, - animations: { - activeDelegate?.sideMenuWillDisappear?(menu: self, animated: animated) - self.transition.hideMenuStart() - }) - UIView.setAnimationsEnabled(areAnimationsEnabled) - } - } - - if let lastViewController = navigationController.viewControllers.last, !sideMenuManager.menuAllowPushOfSameClassTwice && type(of: lastViewController) == type(of: viewController) { - CATransaction.commit() - return - } - - switch sideMenuManager.menuPushStyle { - case .subMenu, .defaultBehavior: break // .subMenu handled earlier, .defaultBehavior falls through to end - case .popWhenPossible: - for subViewController in navigationController.viewControllers.reversed() { - if type(of: subViewController) == type(of: viewController) { - navigationController.popToViewController(subViewController, animated: animated) - CATransaction.commit() - 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 sideMenuManager.menuPushStyle == .preserveAndHideBackButton { - preservedViewController.navigationItem.hidesBackButton = true - } - viewControllers.append(preservedViewController) - navigationController.setViewControllers(viewControllers, animated: animated) - CATransaction.commit() - return - } - if sideMenuManager.menuPushStyle == .preserveAndHideBackButton { - viewController.navigationItem.hidesBackButton = true - } - case .replace: - viewController.navigationItem.hidesBackButton = true - navigationController.setViewControllers([viewController], animated: animated) - CATransaction.commit() - return - } - - navigationController.pushViewController(viewController, animated: animated) - CATransaction.commit() } + /// Indicates if the menu is anywhere in the view hierarchy, even if covered by another view controller. + open var isHidden: Bool { + return presentingViewController == nil + } + + /// 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. + @IBInspectable open var leftSide: Bool { + get { return _leftSide.value } + set { _leftSide.value = newValue } + } +} + +// IMPORTANT: These methods must be declared open or they will not be called. +extension UISideMenuNavigationController: UIViewControllerTransitioningDelegate { + + open func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { + guard let menu = presented as? UISideMenuNavigationController else { return nil } + transitionController = SideMenuTransitionController(options: menu.options) + transitionController?.interactive = sideMenuManager.gestureManager.isTracking + transitionController?.delegate = sideMenuManager + return transitionController + } + + open func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { + transitionController?.interactive = sideMenuManager.gestureManager.isTracking + return transitionController + } + + open func interactionControllerForPresentation(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? { + return interactionController(using: animator) + } + + open func interactionControllerForDismissal(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? { + return interactionController(using: animator) + } + + open func interactionController(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? { + let transitionController = animator as? SideMenuTransitionController + return transitionController?.interactionController + } +} + +// Interface +extension UISideMenuNavigationController: MenuOptions { + + /// Prevents the same view controller (or a view controller of the same class) from being pushed more than once. Defaults to true. + var allowPushOfSameClassTwice: Bool { + get { return options.allowPushOfSameClassTwice } + set { options.allowPushOfSameClassTwice = newValue } + } + + /// Forces menus to always animate when appearing or disappearing, regardless of a pushed view controller's animation. + @IBInspectable var alwaysAnimate: Bool { + get { return options.alwaysAnimate } + set { options.alwaysAnimate = newValue } + } + + /// The animation options when a menu is displayed. Ignored when displayed with a gesture. + open var animationOptions: UIView.AnimationOptions { + get { return options.animationOptions } + set { options.animationOptions = newValue } + } + + /** + The blur effect style of the menu if the menu's root view controller is a UITableViewController or UICollectionViewController. + + - Note: If you want cells in a UITableViewController menu to show vibrancy, make them a subclass of UITableViewVibrantCell. + */ + open var blurEffectStyle: UIBlurEffect.Style? { + get { return options.blurEffectStyle } + set { options.blurEffectStyle = newValue } + } + + /// Duration of the remaining animation when the menu is partially dismissed with gestures. Default is 0.35 seconds. + @IBInspectable open var completeGestureDuration: Double { + get { return options.completeGestureDuration } + set { options.completeGestureDuration = newValue } + } + + /// Animation curve of the remaining animation when the menu is partially dismissed with gestures. Default is .easeIn. + @IBInspectable open var completionCurve: UIView.AnimationCurve { + get { return options.completionCurve } + set { options.completionCurve = newValue } + } + + /// Duration of the animation when the menu is dismissed without gestures. Default is 0.35 seconds. + @IBInspectable open var dismissDuration: Double { + get { return options.dismissDuration } + set { options.dismissDuration = newValue } + } + + /// Automatically dismisses the menu when app goes to the background. + @IBInspectable open var dismissWhenBackgrounded: Bool { + get { return options.dismissWhenBackgrounded } + set { options.dismissWhenBackgrounded = newValue } + } + + /// Automatically dismisses the menu when another view is presented from it. + @IBInspectable open var dismissOnPresent: Bool { + get { return options.dismissOnPush } + set { options.dismissOnPush = newValue } + } + + /// Automatically dismisses the menu when another view controller is pushed from it. + @IBInspectable open var dismissOnPush: Bool { + get { return options.dismissOnPush } + set { options.dismissOnPush = newValue } + } + + /// Enable or disable gestures that would swipe to dismiss the menu. Default is true. + @IBInspectable open var enableSwipeGestures: Bool { + get { return options.enableSwipeGestures } + set { options.enableSwipeGestures = newValue } + } + + /// The animation initial spring velocity when a menu is displayed. Ignored when displayed with a gesture. + @IBInspectable open var initialSpringVelocity: CGFloat { + get { return options.initialSpringVelocity } + set { options.initialSpringVelocity = newValue } + } + + /// Width of the menu when presented on screen, showing the existing view controller in the remaining space. Default is zero. + @IBInspectable open var menuWidth: CGFloat { + get { return options.menuWidth } + set { options.menuWidth = newValue } + } + + /// Enable or disable interaction with the presenting view controller while the menu is displayed. Enabling may make it difficult to dismiss the menu or cause exceptions if the user tries to present and already presented menu. `presentingViewControllerUseSnapshot` must also set to false. Default is false. + @IBInspectable open var presentingViewControllerUserInteractionEnabled: Bool { + get { return options.presentingViewControllerUserInteractionEnabled } + set { options.presentingViewControllerUserInteractionEnabled = newValue } + } + + /// Use a snapshot for the presenting vierw controller while the menu is displayed. Useful when layout changes occur during transitions. Not recommended for apps that support rotation. Default is false. + @IBInspectable open var presentingViewControllerUseSnapshot: Bool { + get { return options.presentingViewControllerUseSnapshot } + set { options.presentingViewControllerUseSnapshot = newValue } + } + + /// Duration of the animation when the menu is presented without gestures. Default is 0.35 seconds. + @IBInspectable var presentDuration: Double { + get { return options.presentDuration } + set { options.presentDuration = newValue } + } + + /** + The presentation stayle of the menu. + + There are four modes in MenuPresentStyle: + - menuSlideIn: Menu slides in over of the existing view. + - viewSlideOut: The existing view slides out to reveal the menu. + - viewSlideInOut: The existing view slides out while the menu slides in. + - menuDissolveIn: The menu dissolves in over the existing view controller. + */ + @IBInspectable open var presentStyle: MenuPresentStyle { + get { return options.presentStyle } + set { options.presentStyle = newValue } + } + + /** + The push style of the menu. + + There are six modes in MenuPushStyle: + - defaultBehavior: The view controller is pushed onto the stack. + - popWhenPossible: If a view controller already in the stack is of the same class as the pushed view controller, the stack is instead popped back to the existing view controller. This behavior can help users from getting lost in a deep navigation stack. + - preserve: If a view controller already in the stack is of the same class as the pushed view controller, the existing view controller is pushed to the end of the stack. This behavior is similar to a UITabBarController. + - preserveAndHideBackButton: Same as .preserve and back buttons are automatically hidden. + - replace: Any existing view controllers are released from the stack and replaced with the pushed view controller. Back buttons are automatically hidden. This behavior is ideal if view controllers require a lot of memory or their state doesn't need to be preserved.. + - subMenu: Unlike all other behaviors that push using the menu's presentingViewController, this behavior pushes view controllers within the menu. Use this behavior if you want to display a sub menu. + */ + @IBInspectable open var pushStyle: MenuPushStyle { + get { return options.pushStyle } + set { options.pushStyle = newValue } + } + + /// The animation spring damping when a menu is displayed. Ignored when displayed with a gesture. + @IBInspectable var usingSpringWithDamping: CGFloat { + get { return options.usingSpringWithDamping } + set { options.usingSpringWithDamping = newValue } + } +} + +internal extension UISideMenuNavigationController { + + weak var activeDelegate: UISideMenuNavigationControllerDelegate? { + guard !view.isHidden else { return nil } + return sideMenuDelegate ?? foundDelegate ?? findDelegate(forViewController: presentingViewController) + } +} + +private extension UISideMenuNavigationController { + + func condition() -> Bool { + return isHidden + } + + private class func elseCondition(_ propertyName: PropertyName) { + Print.warning(.property, arguments: propertyName.rawValue, required: true) + } + + func findDelegate(forViewController: UIViewController?) -> UISideMenuNavigationControllerDelegate? { + if let navigationController = forViewController as? UINavigationController { + return findDelegate(forViewController: navigationController.topViewController) + } + if let tabBarController = forViewController as? UITabBarController { + return findDelegate(forViewController: tabBarController.selectedViewController) + } + if let splitViewController = forViewController as? UISplitViewController { + return findDelegate(forViewController: splitViewController.viewControllers.last) + } + + foundDelegate = forViewController as? UISideMenuNavigationControllerDelegate + return foundDelegate + } + + func setupBlur() { + removeBlur() + + guard let blurEffectStyle = blurEffectStyle, + let view = topViewController?.view, + !UIAccessibility.isReduceTransparencyEnabled else { + return + } + + if originalBackgroundColor == nil { + originalBackgroundColor = view.backgroundColor + } + + let blurEffect = UIBlurEffect(style: blurEffectStyle) + let blurView = UIVisualEffectView(effect: blurEffect) + view.backgroundColor = UIColor.clear + if let tableViewController = topViewController as? UITableViewController { + tableViewController.tableView.backgroundView = blurView + tableViewController.tableView.separatorEffect = UIVibrancyEffect(blurEffect: blurEffect) + tableViewController.tableView.reloadData() + } else { + blurView.autoresizingMask = [.flexibleHeight, .flexibleWidth] + blurView.frame = view.bounds + view.insertSubview(blurView, at: 0) + } + } + + func removeBlur() { + guard let originalBackgroundColor = originalBackgroundColor, + let view = topViewController?.view else { + return + } + + view.backgroundColor = originalBackgroundColor + self.originalBackgroundColor = nil + + if let tableViewController = topViewController as? UITableViewController { + tableViewController.tableView.backgroundView = nil + tableViewController.tableView.separatorEffect = nil + tableViewController.tableView.reloadData() + } else if let blurView = view.subviews.first as? UIVisualEffectView { + blurView.removeFromSuperview() + } + } } diff --git a/Podfile.lock b/Podfile.lock index f36f856..34ef9e4 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,5 +1,5 @@ PODS: - - SideMenu (2.0.5) + - SideMenu (5.0.3) DEPENDENCIES: - SideMenu (from `.`) @@ -9,8 +9,8 @@ EXTERNAL SOURCES: :path: "." SPEC CHECKSUMS: - SideMenu: 0ecfd407b24e7d36c57fc50ca7f5d7cedb7c8841 + SideMenu: 1dcaabce84538c53325c287f7fe62999379a641c -PODFILE CHECKSUM: 58fed701dc13a7835ed36507e7cf19fa22035003 +PODFILE CHECKSUM: 863f183ea1ab6f64dc8553590349c586faf8e4a1 -COCOAPODS: 1.1.1 +COCOAPODS: 1.6.0.beta.2 diff --git a/Pods/Local Podspecs/SideMenu.podspec.json b/Pods/Local Podspecs/SideMenu.podspec.json index f644909..fefaaee 100644 --- a/Pods/Local Podspecs/SideMenu.podspec.json +++ b/Pods/Local Podspecs/SideMenu.podspec.json @@ -1,6 +1,6 @@ { "name": "SideMenu", - "version": "2.0.5", + "version": "5.0.3", "summary": "Simple side menu control for iOS in Swift inspired by Facebook. Right and Left sides. No coding required.", "description": "SideMenu is a simple and versatile side menu control. It's highly customizable, but can also be implemented in storyboard without a single line of code. The are three standard animation styles to choose from along with several other options for further customization if desired. Just type SideMenuManager.menu... and code completion will show you everything you can customize.", "homepage": "https://github.com/jonkykong/SideMenu", @@ -19,10 +19,11 @@ }, "source": { "git": "https://github.com/jonkykong/SideMenu.git", - "tag": "2.0.5" + "tag": "5.0.3" }, "platforms": { - "ios": "8.0" + "ios": "10.0" }, + "swift_version": "4.2", "source_files": "Pod/Classes/**/*" } diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock index f36f856..34ef9e4 100644 --- a/Pods/Manifest.lock +++ b/Pods/Manifest.lock @@ -1,5 +1,5 @@ PODS: - - SideMenu (2.0.5) + - SideMenu (5.0.3) DEPENDENCIES: - SideMenu (from `.`) @@ -9,8 +9,8 @@ EXTERNAL SOURCES: :path: "." SPEC CHECKSUMS: - SideMenu: 0ecfd407b24e7d36c57fc50ca7f5d7cedb7c8841 + SideMenu: 1dcaabce84538c53325c287f7fe62999379a641c -PODFILE CHECKSUM: 58fed701dc13a7835ed36507e7cf19fa22035003 +PODFILE CHECKSUM: 863f183ea1ab6f64dc8553590349c586faf8e4a1 -COCOAPODS: 1.1.1 +COCOAPODS: 1.6.0.beta.2 diff --git a/Pods/Pods.xcodeproj/project.pbxproj b/Pods/Pods.xcodeproj/project.pbxproj index 371d4db..5d702db 100644 --- a/Pods/Pods.xcodeproj/project.pbxproj +++ b/Pods/Pods.xcodeproj/project.pbxproj @@ -7,182 +7,121 @@ objects = { /* Begin PBXBuildFile section */ - 33A2C5F2EAE34300A4979EEA1BDF2024 /* Pods-Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = D89D4894CEA08192B43B2B91096D07DA /* Pods-Example-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 421CA3A5546869DBBAF84AF6809D754E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CBB3DE36805AF21409EC968A9691732F /* Foundation.framework */; }; - 44764B4595A3711C6EBF5FC60678007F /* SideMenuTransition.swift in Sources */ = {isa = PBXBuildFile; fileRef = B07BF4307D6570422A733023757BEF89 /* SideMenuTransition.swift */; }; - 6580F9C3F1EBB3D0785C89F35BF8C86A /* UITableViewVibrantCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1EDDBD85218245F18D702A3575473C8 /* UITableViewVibrantCell.swift */; }; - 7F8EFBD376892EC0F8013FB380642EDD /* Pods-Example-ExampleTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 332B95F61B515CDC98B251A241E5D43B /* Pods-Example-ExampleTests-dummy.m */; }; - 972928D756FAA7AF3294E990C74FA299 /* Pods-Example-ExampleTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 2084F48895C3AF444C35473ABCA8111B /* Pods-Example-ExampleTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - AF08A79402D28A2246CB457E37D8808F /* SideMenu-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A333BC49F26DD9B490D619F18482A67 /* SideMenu-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - B1EEEB049B4B68A2F30FD7E723AC8CAA /* Pods-Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = C72D139AB2B9B4039257CFB64A160F6A /* Pods-Example-dummy.m */; }; - B2DE42ECE9E7637363A79FAA108D3A87 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CBB3DE36805AF21409EC968A9691732F /* Foundation.framework */; }; - BCF762B5EB0CAA436BE780C28FA67BD8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CBB3DE36805AF21409EC968A9691732F /* Foundation.framework */; }; - BFF035CF7CB3E4736ED1E7025895E489 /* UISideMenuNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3E181575D6EB38AFB0151BD2F8BA31B /* UISideMenuNavigationController.swift */; }; - C440D29F0451660C7ED6D0EE38A772A8 /* SideMenuManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DA23134F89BC18C4A2405BD1AAB1C5A /* SideMenuManager.swift */; }; - F9964FE734CF6BCAE242E74EE44FCD1E /* SideMenu-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = D55BD231475053E79706FE84F5EE39FF /* SideMenu-dummy.m */; }; + 01139840C659D09F62B241AAA4930DDB /* Pods-Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 5272241D4675EBF4B77A6B77E33CF611 /* Pods-Example-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 349F92663C5B5C66B550F75A1CBEFC83 /* SideMenu-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = E22FD0C23A76B008D56CF2DB76597F95 /* SideMenu-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 36A46EAC7A7B7738F80C648EDF47DBD4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6DFF15000AFE2A371BF499E7AFDA808 /* Foundation.framework */; }; + 40D0942A4F043C8F32E46B87F2567931 /* UITableViewVibrantCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5362C3E90D0411B7A1153811DEFA8E4 /* UITableViewVibrantCell.swift */; }; + 5365F93B3E5F4D3D9E1DA2EDCAF7F93B /* SideMenuPresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FECF363D37A4A8B719135B1848C02CD4 /* SideMenuPresentationController.swift */; }; + 6672CE381BB9B1A0D633B5E98E9A412E /* Print.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC20F98687A109E1FDAD74BC62911299 /* Print.swift */; }; + 7CFEB3863F8BB185CD0E835E302E229C /* UISideMenuNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E69DF5906E981028F065B72E0F0C227 /* UISideMenuNavigationController.swift */; }; + 84241FB721D6CB50002D4862 /* SideMenuInteractionController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84241FB621D6CB50002D4862 /* SideMenuInteractionController.swift */; }; + 84241FB921D7FCA2002D4862 /* SideMenuGestureManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84241FB821D7FCA2002D4862 /* SideMenuGestureManager.swift */; }; + 84241FBB21D81885002D4862 /* SideMenuPresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84241FBA21D81885002D4862 /* SideMenuPresentable.swift */; }; + 8436EF15220EE97800A8861A /* Protected.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8436EF14220EE97800A8861A /* Protected.swift */; }; + 8BC8C3FB652840612047B49E8D4B3B44 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6DFF15000AFE2A371BF499E7AFDA808 /* Foundation.framework */; }; + B912EBCBB29DDE29695D0E58BC145396 /* SideMenuTransitionController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 383C67B923116765AC95EC08436448D4 /* SideMenuTransitionController.swift */; }; + BD3D0DAA6FBD9D2E54C807C55E287223 /* SideMenu-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 6928960C76E1B7820688E60500A05DFD /* SideMenu-dummy.m */; }; + D3B1E46DFEE3C36D413C60BA994895F7 /* SideMenuManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61E50E81F13B12673E4A96C971B6DFC7 /* SideMenuManager.swift */; }; + F4D3A1493EDF1ABBB874672FCC974995 /* Pods-Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = B7F47266550AC865B9D4E1AD83140218 /* Pods-Example-dummy.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 13F1E8AC3A9E5CE2BBE7D8ECE1C25B5A /* PBXContainerItemProxy */ = { + F0BB12FC8831738F67A75ACD3F75E763 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = 88B64A039CB85A823B85B2EF1C336387; - remoteInfo = SideMenu; - }; - 9990A5EC46C331A7DBA54540D40C9C65 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 88B64A039CB85A823B85B2EF1C336387; + remoteGlobalIDString = C20E4A286FAAC9347B13B07AE3AB4408; remoteInfo = SideMenu; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 07CF24DC4BFD5F1173903F48778BFE4D /* Pods-Example-ExampleTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Example-ExampleTests-resources.sh"; sourceTree = ""; }; - 08E21DD9D71D075A612385031DC79A22 /* SideMenu.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = SideMenu.xcconfig; sourceTree = ""; }; - 0A333BC49F26DD9B490D619F18482A67 /* SideMenu-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SideMenu-umbrella.h"; sourceTree = ""; }; - 2084F48895C3AF444C35473ABCA8111B /* Pods-Example-ExampleTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-Example-ExampleTests-umbrella.h"; sourceTree = ""; }; - 2348B40EA81B72B0A6811DB15AA54EBC /* Pods-Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-Example.modulemap"; sourceTree = ""; }; - 2C88E8FAC348C16590C54BCE30E6B57A /* Pods_Example_ExampleTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example_ExampleTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 3324698B7EF536D06111969551D7A984 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Example.debug.xcconfig"; sourceTree = ""; }; - 332B95F61B515CDC98B251A241E5D43B /* Pods-Example-ExampleTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-Example-ExampleTests-dummy.m"; sourceTree = ""; }; - 36B76185E3FED903CA91C68529213854 /* Pods-Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Example-frameworks.sh"; sourceTree = ""; }; - 36CF7D6DA1B99FEA132A604D0BF8FB58 /* Pods-Example-ExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Example-ExampleTests.release.xcconfig"; sourceTree = ""; }; - 3F8788A93374FA1E624C16A1B3685F53 /* Pods-Example-ExampleTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Example-ExampleTests-frameworks.sh"; sourceTree = ""; }; - 5011808F2ED3C26F841E1EFC102AB059 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 50F62549C77911B6EE890857E0536AE9 /* SideMenu.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SideMenu.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 5606603944FAF0E374BBF2C47F7497B1 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 77EF2A659065FC33BF2794FDC8B7EEEE /* Pods-Example-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Example-resources.sh"; sourceTree = ""; }; - 78235096D8779971EDD9CA1B6ED97365 /* Pods-Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-Example-acknowledgements.markdown"; sourceTree = ""; }; - 7CAC7C8AA53EBC987714BAC240E7DE89 /* Pods-Example-ExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Example-ExampleTests.debug.xcconfig"; sourceTree = ""; }; - 865E509FE5E2D2AFB191A07999883E2C /* SideMenu.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = SideMenu.modulemap; sourceTree = ""; }; - 8A7970A47C536A981D4F22B299CB42BB /* Pods-Example-ExampleTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-Example-ExampleTests-acknowledgements.plist"; sourceTree = ""; }; - 8CFEB0BE5ACBE02522949DD724E59BBB /* SideMenu-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SideMenu-prefix.pch"; sourceTree = ""; }; - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - 9DA23134F89BC18C4A2405BD1AAB1C5A /* SideMenuManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SideMenuManager.swift; sourceTree = ""; }; - A1EDDBD85218245F18D702A3575473C8 /* UITableViewVibrantCell.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UITableViewVibrantCell.swift; sourceTree = ""; }; - B07BF4307D6570422A733023757BEF89 /* SideMenuTransition.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SideMenuTransition.swift; sourceTree = ""; }; - B217AC37DF451BF580A50C409FB9AB26 /* Pods-Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-Example-acknowledgements.plist"; sourceTree = ""; }; - C72D139AB2B9B4039257CFB64A160F6A /* Pods-Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-Example-dummy.m"; sourceTree = ""; }; - CBB3DE36805AF21409EC968A9691732F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - D55BD231475053E79706FE84F5EE39FF /* SideMenu-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "SideMenu-dummy.m"; sourceTree = ""; }; - D89D4894CEA08192B43B2B91096D07DA /* Pods-Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-Example-umbrella.h"; sourceTree = ""; }; - E1F28072649ECE3811FDC975060DE2C0 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - E3E181575D6EB38AFB0151BD2F8BA31B /* UISideMenuNavigationController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UISideMenuNavigationController.swift; sourceTree = ""; }; - E84078875951590B4A5503E807E1791E /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Example.release.xcconfig"; sourceTree = ""; }; - EA6D9331F9DD9F21BC7C3A10DA8650E9 /* Pods-Example-ExampleTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-Example-ExampleTests.modulemap"; sourceTree = ""; }; - ED2007ADAFCA1F4044E5B3E2A2A5C4B2 /* Pods-Example-ExampleTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-Example-ExampleTests-acknowledgements.markdown"; sourceTree = ""; }; - FFBC1ECA8C19FDC42CE28126F97A420D /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 301294CB75553E9EBCB6489A7E166B9D /* SideMenu.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SideMenu.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 330E8F111F6CC3583363DDD48C57361D /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; + 383C67B923116765AC95EC08436448D4 /* SideMenuTransitionController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SideMenuTransitionController.swift; path = Pod/Classes/SideMenuTransitionController.swift; sourceTree = ""; }; + 3B8B0143E6CED03BACC9E26E0D48EED9 /* SideMenu.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; path = SideMenu.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 4C64B10F97AB02EB59B9CBC9FC973479 /* Pods-Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Example-frameworks.sh"; sourceTree = ""; }; + 515C651099897C83996403DC88924974 /* Pods-Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-Example.modulemap"; sourceTree = ""; }; + 5272241D4675EBF4B77A6B77E33CF611 /* Pods-Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-Example-umbrella.h"; sourceTree = ""; }; + 52EB128553BCCD0A43A7713241401647 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Example.debug.xcconfig"; sourceTree = ""; }; + 61E50E81F13B12673E4A96C971B6DFC7 /* SideMenuManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SideMenuManager.swift; path = Pod/Classes/SideMenuManager.swift; sourceTree = ""; }; + 686D1182FD3A00C3BB4C1854EF32B2B3 /* SideMenu.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = SideMenu.modulemap; sourceTree = ""; }; + 6928960C76E1B7820688E60500A05DFD /* SideMenu-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "SideMenu-dummy.m"; sourceTree = ""; }; + 6E69DF5906E981028F065B72E0F0C227 /* UISideMenuNavigationController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = UISideMenuNavigationController.swift; path = Pod/Classes/UISideMenuNavigationController.swift; sourceTree = ""; }; + 84241FB621D6CB50002D4862 /* SideMenuInteractionController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SideMenuInteractionController.swift; path = Pod/Classes/SideMenuInteractionController.swift; sourceTree = ""; }; + 84241FB821D7FCA2002D4862 /* SideMenuGestureManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SideMenuGestureManager.swift; path = Pod/Classes/SideMenuGestureManager.swift; sourceTree = ""; }; + 84241FBA21D81885002D4862 /* SideMenuPresentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SideMenuPresentable.swift; sourceTree = ""; }; + 8436EF14220EE97800A8861A /* Protected.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Protected.swift; path = Pod/Classes/Protected.swift; sourceTree = ""; }; + 8B22924AF0FECF030E052A8783CA4120 /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8B278378E8AE995FBE26E513BED2DB8E /* Pods-Example-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-Example-Info.plist"; sourceTree = ""; }; + A41DC801C5F8DBE5C88BD0DB5E6AB40F /* SideMenu.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = SideMenu.xcconfig; sourceTree = ""; }; + A5362C3E90D0411B7A1153811DEFA8E4 /* UITableViewVibrantCell.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = UITableViewVibrantCell.swift; path = Pod/Classes/UITableViewVibrantCell.swift; sourceTree = ""; }; + B049B4849AF3113C3580161606670F39 /* Pods-Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-Example-acknowledgements.plist"; sourceTree = ""; }; + B1ADEBEDECEB5C6BE46D07DB0411E5D7 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; + B36AB396275697EEE1A5B13BA8A38FE3 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + B5A5215990CD9B9E302D772EF78A87E1 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Example.release.xcconfig"; sourceTree = ""; }; + B7F47266550AC865B9D4E1AD83140218 /* Pods-Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-Example-dummy.m"; sourceTree = ""; }; + B8C52DB0A07991B80C764720AD41E9B9 /* SideMenu-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "SideMenu-Info.plist"; sourceTree = ""; }; + D6DFF15000AFE2A371BF499E7AFDA808 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + DC20F98687A109E1FDAD74BC62911299 /* Print.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Print.swift; path = Pod/Classes/Print.swift; sourceTree = ""; }; + E22FD0C23A76B008D56CF2DB76597F95 /* SideMenu-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SideMenu-umbrella.h"; sourceTree = ""; }; + F34353F775E9E7D79176839735E2D482 /* Pods-Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-Example-acknowledgements.markdown"; sourceTree = ""; }; + FBFD9416D9EF102F5D6AD79D65320CBA /* SideMenu-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SideMenu-prefix.pch"; sourceTree = ""; }; + FECF363D37A4A8B719135B1848C02CD4 /* SideMenuPresentationController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SideMenuPresentationController.swift; path = Pod/Classes/SideMenuPresentationController.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 28EE18B02A4ED69290D6E21608BEB58B /* Frameworks */ = { + 2771B2872DCC00300FDF4C29E723B2B8 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 421CA3A5546869DBBAF84AF6809D754E /* Foundation.framework in Frameworks */, + 36A46EAC7A7B7738F80C648EDF47DBD4 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 77A5C759621DD4A6C4AC46562B1A7571 /* Frameworks */ = { + 9FADC1B0E48639924E539037DD5D67CC /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BCF762B5EB0CAA436BE780C28FA67BD8 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E4B77B925741C9DE2BB6D2CD0DAC84A0 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - B2DE42ECE9E7637363A79FAA108D3A87 /* Foundation.framework in Frameworks */, + 8BC8C3FB652840612047B49E8D4B3B44 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 2B3C616BF26458CD5235A4587242B7AB /* Targets Support Files */ = { + 33938916B3FCB8DACAED360C907C4115 /* SideMenu */ = { isa = PBXGroup; children = ( - 5049A1312FC5E111500ACCC3CD03F4F5 /* Pods-Example */, - 515965F8914CBAD0C2FF576920DBC879 /* Pods-Example-ExampleTests */, - ); - name = "Targets Support Files"; - sourceTree = ""; - }; - 44F245AFC5E8BF7E600403F8FB1C32BB /* Development Pods */ = { - isa = PBXGroup; - children = ( - 60735B00595F78E329E2A4C4A52AE25F /* SideMenu */, - ); - name = "Development Pods"; - sourceTree = ""; - }; - 4C1BF1B0098F45697127CC032B5DE324 /* Classes */ = { - isa = PBXGroup; - children = ( - 9DA23134F89BC18C4A2405BD1AAB1C5A /* SideMenuManager.swift */, - B07BF4307D6570422A733023757BEF89 /* SideMenuTransition.swift */, - E3E181575D6EB38AFB0151BD2F8BA31B /* UISideMenuNavigationController.swift */, - A1EDDBD85218245F18D702A3575473C8 /* UITableViewVibrantCell.swift */, - ); - path = Classes; - sourceTree = ""; - }; - 5049A1312FC5E111500ACCC3CD03F4F5 /* Pods-Example */ = { - isa = PBXGroup; - children = ( - 5011808F2ED3C26F841E1EFC102AB059 /* Info.plist */, - 2348B40EA81B72B0A6811DB15AA54EBC /* Pods-Example.modulemap */, - 78235096D8779971EDD9CA1B6ED97365 /* Pods-Example-acknowledgements.markdown */, - B217AC37DF451BF580A50C409FB9AB26 /* Pods-Example-acknowledgements.plist */, - C72D139AB2B9B4039257CFB64A160F6A /* Pods-Example-dummy.m */, - 36B76185E3FED903CA91C68529213854 /* Pods-Example-frameworks.sh */, - 77EF2A659065FC33BF2794FDC8B7EEEE /* Pods-Example-resources.sh */, - D89D4894CEA08192B43B2B91096D07DA /* Pods-Example-umbrella.h */, - 3324698B7EF536D06111969551D7A984 /* Pods-Example.debug.xcconfig */, - E84078875951590B4A5503E807E1791E /* Pods-Example.release.xcconfig */, - ); - name = "Pods-Example"; - path = "Target Support Files/Pods-Example"; - sourceTree = ""; - }; - 515965F8914CBAD0C2FF576920DBC879 /* Pods-Example-ExampleTests */ = { - isa = PBXGroup; - children = ( - E1F28072649ECE3811FDC975060DE2C0 /* Info.plist */, - EA6D9331F9DD9F21BC7C3A10DA8650E9 /* Pods-Example-ExampleTests.modulemap */, - ED2007ADAFCA1F4044E5B3E2A2A5C4B2 /* Pods-Example-ExampleTests-acknowledgements.markdown */, - 8A7970A47C536A981D4F22B299CB42BB /* Pods-Example-ExampleTests-acknowledgements.plist */, - 332B95F61B515CDC98B251A241E5D43B /* Pods-Example-ExampleTests-dummy.m */, - 3F8788A93374FA1E624C16A1B3685F53 /* Pods-Example-ExampleTests-frameworks.sh */, - 07CF24DC4BFD5F1173903F48778BFE4D /* Pods-Example-ExampleTests-resources.sh */, - 2084F48895C3AF444C35473ABCA8111B /* Pods-Example-ExampleTests-umbrella.h */, - 7CAC7C8AA53EBC987714BAC240E7DE89 /* Pods-Example-ExampleTests.debug.xcconfig */, - 36CF7D6DA1B99FEA132A604D0BF8FB58 /* Pods-Example-ExampleTests.release.xcconfig */, - ); - name = "Pods-Example-ExampleTests"; - path = "Target Support Files/Pods-Example-ExampleTests"; - sourceTree = ""; - }; - 60735B00595F78E329E2A4C4A52AE25F /* SideMenu */ = { - isa = PBXGroup; - children = ( - C2AF4F7AEEE7FEE3C8D1B7C76D4B1525 /* Pod */, - E948A8F84BA9E497AACCD1262869AEFD /* Support Files */, + DC20F98687A109E1FDAD74BC62911299 /* Print.swift */, + 8436EF14220EE97800A8861A /* Protected.swift */, + 61E50E81F13B12673E4A96C971B6DFC7 /* SideMenuManager.swift */, + 84241FB821D7FCA2002D4862 /* SideMenuGestureManager.swift */, + FECF363D37A4A8B719135B1848C02CD4 /* SideMenuPresentationController.swift */, + 383C67B923116765AC95EC08436448D4 /* SideMenuTransitionController.swift */, + 84241FB621D6CB50002D4862 /* SideMenuInteractionController.swift */, + 6E69DF5906E981028F065B72E0F0C227 /* UISideMenuNavigationController.swift */, + A5362C3E90D0411B7A1153811DEFA8E4 /* UITableViewVibrantCell.swift */, + 84241FBA21D81885002D4862 /* SideMenuPresentable.swift */, + 8FA2C91F7C098E55AD6C36A44D885E67 /* Pod */, + 9F412C3C9DC9016F76368C6285235102 /* Support Files */, ); name = SideMenu; path = ..; sourceTree = ""; }; - 7531C8F8DE19F1AA3C8A7AC97A91DC29 /* iOS */ = { + 3BFB1236E5F61C24E4383B2E5824E66B /* Targets Support Files */ = { isa = PBXGroup; children = ( - CBB3DE36805AF21409EC968A9691732F /* Foundation.framework */, + 7E254EED88672C0A42F3C39323E65024 /* Pods-Example */, + ); + name = "Targets Support Files"; + sourceTree = ""; + }; + 44D5347904CF754D6785B84253F2574A /* iOS */ = { + isa = PBXGroup; + children = ( + D6DFF15000AFE2A371BF499E7AFDA808 /* Foundation.framework */, ); name = iOS; sourceTree = ""; @@ -190,91 +129,110 @@ 7DB346D0F39D3F0E887471402A8071AB = { isa = PBXGroup; children = ( - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, - 44F245AFC5E8BF7E600403F8FB1C32BB /* Development Pods */, + B36AB396275697EEE1A5B13BA8A38FE3 /* Podfile */, + D1D35F6C5A3D05EADEDA2AB07070F583 /* Development Pods */, BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */, - 7F81920EACC4C715BA3D737D2ED090F2 /* Products */, - 2B3C616BF26458CD5235A4587242B7AB /* Targets Support Files */, + E68B0F0756CE9B8AB20FA005BEAAA751 /* Products */, + 3BFB1236E5F61C24E4383B2E5824E66B /* Targets Support Files */, ); sourceTree = ""; }; - 7F81920EACC4C715BA3D737D2ED090F2 /* Products */ = { + 7E254EED88672C0A42F3C39323E65024 /* Pods-Example */ = { isa = PBXGroup; children = ( - FFBC1ECA8C19FDC42CE28126F97A420D /* Pods_Example.framework */, - 2C88E8FAC348C16590C54BCE30E6B57A /* Pods_Example_ExampleTests.framework */, - 50F62549C77911B6EE890857E0536AE9 /* SideMenu.framework */, + 515C651099897C83996403DC88924974 /* Pods-Example.modulemap */, + F34353F775E9E7D79176839735E2D482 /* Pods-Example-acknowledgements.markdown */, + B049B4849AF3113C3580161606670F39 /* Pods-Example-acknowledgements.plist */, + B7F47266550AC865B9D4E1AD83140218 /* Pods-Example-dummy.m */, + 4C64B10F97AB02EB59B9CBC9FC973479 /* Pods-Example-frameworks.sh */, + 8B278378E8AE995FBE26E513BED2DB8E /* Pods-Example-Info.plist */, + 5272241D4675EBF4B77A6B77E33CF611 /* Pods-Example-umbrella.h */, + 52EB128553BCCD0A43A7713241401647 /* Pods-Example.debug.xcconfig */, + B5A5215990CD9B9E302D772EF78A87E1 /* Pods-Example.release.xcconfig */, ); - name = Products; + name = "Pods-Example"; + path = "Target Support Files/Pods-Example"; sourceTree = ""; }; - BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */ = { + 8FA2C91F7C098E55AD6C36A44D885E67 /* Pod */ = { isa = PBXGroup; children = ( - 7531C8F8DE19F1AA3C8A7AC97A91DC29 /* iOS */, + B1ADEBEDECEB5C6BE46D07DB0411E5D7 /* LICENSE */, + 330E8F111F6CC3583363DDD48C57361D /* README.md */, + 3B8B0143E6CED03BACC9E26E0D48EED9 /* SideMenu.podspec */, ); - name = Frameworks; + name = Pod; sourceTree = ""; }; - C2AF4F7AEEE7FEE3C8D1B7C76D4B1525 /* Pod */ = { + 9F412C3C9DC9016F76368C6285235102 /* Support Files */ = { isa = PBXGroup; children = ( - 4C1BF1B0098F45697127CC032B5DE324 /* Classes */, - ); - path = Pod; - sourceTree = ""; - }; - E948A8F84BA9E497AACCD1262869AEFD /* Support Files */ = { - isa = PBXGroup; - children = ( - 5606603944FAF0E374BBF2C47F7497B1 /* Info.plist */, - 865E509FE5E2D2AFB191A07999883E2C /* SideMenu.modulemap */, - 08E21DD9D71D075A612385031DC79A22 /* SideMenu.xcconfig */, - D55BD231475053E79706FE84F5EE39FF /* SideMenu-dummy.m */, - 8CFEB0BE5ACBE02522949DD724E59BBB /* SideMenu-prefix.pch */, - 0A333BC49F26DD9B490D619F18482A67 /* SideMenu-umbrella.h */, + 686D1182FD3A00C3BB4C1854EF32B2B3 /* SideMenu.modulemap */, + A41DC801C5F8DBE5C88BD0DB5E6AB40F /* SideMenu.xcconfig */, + 6928960C76E1B7820688E60500A05DFD /* SideMenu-dummy.m */, + B8C52DB0A07991B80C764720AD41E9B9 /* SideMenu-Info.plist */, + FBFD9416D9EF102F5D6AD79D65320CBA /* SideMenu-prefix.pch */, + E22FD0C23A76B008D56CF2DB76597F95 /* SideMenu-umbrella.h */, ); name = "Support Files"; path = "Pods/Target Support Files/SideMenu"; sourceTree = ""; }; + BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */ = { + isa = PBXGroup; + children = ( + 44D5347904CF754D6785B84253F2574A /* iOS */, + ); + name = Frameworks; + sourceTree = ""; + }; + D1D35F6C5A3D05EADEDA2AB07070F583 /* Development Pods */ = { + isa = PBXGroup; + children = ( + 33938916B3FCB8DACAED360C907C4115 /* SideMenu */, + ); + name = "Development Pods"; + sourceTree = ""; + }; + E68B0F0756CE9B8AB20FA005BEAAA751 /* Products */ = { + isa = PBXGroup; + children = ( + 8B22924AF0FECF030E052A8783CA4120 /* Pods_Example.framework */, + 301294CB75553E9EBCB6489A7E166B9D /* SideMenu.framework */, + ); + name = Products; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ - 0BEA866370C97686BE54BFDDAFB80D6B /* Headers */ = { + 38D0BC34892D2809E84D940BCCDF2659 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 33A2C5F2EAE34300A4979EEA1BDF2024 /* Pods-Example-umbrella.h in Headers */, + 349F92663C5B5C66B550F75A1CBEFC83 /* SideMenu-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; - C58B49F352F84B66BC6BE3C9DD41644E /* Headers */ = { + 8C251DA6050869F0A0F5BB0E7BD08F0D /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - AF08A79402D28A2246CB457E37D8808F /* SideMenu-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F7B18C4408931F92F49C897FC51EE4C4 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 972928D756FAA7AF3294E990C74FA299 /* Pods-Example-ExampleTests-umbrella.h in Headers */, + 01139840C659D09F62B241AAA4930DDB /* Pods-Example-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 88B64A039CB85A823B85B2EF1C336387 /* SideMenu */ = { + C20E4A286FAAC9347B13B07AE3AB4408 /* SideMenu */ = { isa = PBXNativeTarget; - buildConfigurationList = E9B38AF86661BDD2119B9A4BC90291A8 /* Build configuration list for PBXNativeTarget "SideMenu" */; + buildConfigurationList = A688B68085115C8E33A7F0F3070A1CB1 /* Build configuration list for PBXNativeTarget "SideMenu" */; buildPhases = ( - 38EA23EA1DA8CE31E8A93F1E42C2EBEF /* Sources */, - 77A5C759621DD4A6C4AC46562B1A7571 /* Frameworks */, - C58B49F352F84B66BC6BE3C9DD41644E /* Headers */, + 38D0BC34892D2809E84D940BCCDF2659 /* Headers */, + 020FBA49BF36EE6560CB14EDF50E5F6C /* Sources */, + 9FADC1B0E48639924E539037DD5D67CC /* Frameworks */, + 414CA1DADCDA72C730DCAB2D992391A1 /* Resources */, ); buildRules = ( ); @@ -282,43 +240,26 @@ ); name = SideMenu; productName = SideMenu; - productReference = 50F62549C77911B6EE890857E0536AE9 /* SideMenu.framework */; + productReference = 301294CB75553E9EBCB6489A7E166B9D /* SideMenu.framework */; productType = "com.apple.product-type.framework"; }; - C2F70AE6C50C2ED01A7D0509E782299D /* Pods-Example-ExampleTests */ = { + C2EA6D72FF69767F00563E21A744577F /* Pods-Example */ = { isa = PBXNativeTarget; - buildConfigurationList = 0E45F5EFF394BFD1E1C17B47E6B8DD5C /* Build configuration list for PBXNativeTarget "Pods-Example-ExampleTests" */; + buildConfigurationList = B479D8172A397C052E8B14B0683B3BD5 /* Build configuration list for PBXNativeTarget "Pods-Example" */; buildPhases = ( - 4782265D5F020DE7CABBF410B06DD15B /* Sources */, - E4B77B925741C9DE2BB6D2CD0DAC84A0 /* Frameworks */, - F7B18C4408931F92F49C897FC51EE4C4 /* Headers */, + 8C251DA6050869F0A0F5BB0E7BD08F0D /* Headers */, + CD15CD366C008017070A90DB00FD7460 /* Sources */, + 2771B2872DCC00300FDF4C29E723B2B8 /* Frameworks */, + 9E1A67E3E3EBEF73A7A6D40CC249C1C6 /* Resources */, ); buildRules = ( ); dependencies = ( - 25DFFD34259255CE6E4D22BC68A7080D /* PBXTargetDependency */, - ); - name = "Pods-Example-ExampleTests"; - productName = "Pods-Example-ExampleTests"; - productReference = 2C88E8FAC348C16590C54BCE30E6B57A /* Pods_Example_ExampleTests.framework */; - productType = "com.apple.product-type.framework"; - }; - C7D9C9E26DE641C8325A89D7BF04BE79 /* Pods-Example */ = { - isa = PBXNativeTarget; - buildConfigurationList = 8E99E955CA34AB6CCE699D92A2878C2C /* Build configuration list for PBXNativeTarget "Pods-Example" */; - buildPhases = ( - DDC7C7FE5A287037FC683859DCEEBF69 /* Sources */, - 28EE18B02A4ED69290D6E21608BEB58B /* Frameworks */, - 0BEA866370C97686BE54BFDDAFB80D6B /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - 23F5F055342FBD9B1613BBEC36B347AD /* PBXTargetDependency */, + 898FCFE56243007FF98ADED3D761336D /* PBXTargetDependency */, ); name = "Pods-Example"; productName = "Pods-Example"; - productReference = FFBC1ECA8C19FDC42CE28126F97A420D /* Pods_Example.framework */; + productReference = 8B22924AF0FECF030E052A8783CA4120 /* Pods_Example.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ @@ -327,13 +268,8 @@ D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0730; + LastSwiftUpdateCheck = 0930; LastUpgradeCheck = 0930; - TargetAttributes = { - 88B64A039CB85A823B85B2EF1C336387 = { - LastSwiftMigration = 1000; - }; - }; }; buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; compatibilityVersion = "Xcode 3.2"; @@ -343,79 +279,90 @@ en, ); mainGroup = 7DB346D0F39D3F0E887471402A8071AB; - productRefGroup = 7F81920EACC4C715BA3D737D2ED090F2 /* Products */; + productRefGroup = E68B0F0756CE9B8AB20FA005BEAAA751 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - C7D9C9E26DE641C8325A89D7BF04BE79 /* Pods-Example */, - C2F70AE6C50C2ED01A7D0509E782299D /* Pods-Example-ExampleTests */, - 88B64A039CB85A823B85B2EF1C336387 /* SideMenu */, + C2EA6D72FF69767F00563E21A744577F /* Pods-Example */, + C20E4A286FAAC9347B13B07AE3AB4408 /* SideMenu */, ); }; /* End PBXProject section */ +/* Begin PBXResourcesBuildPhase section */ + 414CA1DADCDA72C730DCAB2D992391A1 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 9E1A67E3E3EBEF73A7A6D40CC249C1C6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ - 38EA23EA1DA8CE31E8A93F1E42C2EBEF /* Sources */ = { + 020FBA49BF36EE6560CB14EDF50E5F6C /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - F9964FE734CF6BCAE242E74EE44FCD1E /* SideMenu-dummy.m in Sources */, - C440D29F0451660C7ED6D0EE38A772A8 /* SideMenuManager.swift in Sources */, - 44764B4595A3711C6EBF5FC60678007F /* SideMenuTransition.swift in Sources */, - BFF035CF7CB3E4736ED1E7025895E489 /* UISideMenuNavigationController.swift in Sources */, - 6580F9C3F1EBB3D0785C89F35BF8C86A /* UITableViewVibrantCell.swift in Sources */, + 6672CE381BB9B1A0D633B5E98E9A412E /* Print.swift in Sources */, + 84241FB721D6CB50002D4862 /* SideMenuInteractionController.swift in Sources */, + BD3D0DAA6FBD9D2E54C807C55E287223 /* SideMenu-dummy.m in Sources */, + 8436EF15220EE97800A8861A /* Protected.swift in Sources */, + 84241FBB21D81885002D4862 /* SideMenuPresentable.swift in Sources */, + 84241FB921D7FCA2002D4862 /* SideMenuGestureManager.swift in Sources */, + D3B1E46DFEE3C36D413C60BA994895F7 /* SideMenuManager.swift in Sources */, + 5365F93B3E5F4D3D9E1DA2EDCAF7F93B /* SideMenuPresentationController.swift in Sources */, + B912EBCBB29DDE29695D0E58BC145396 /* SideMenuTransitionController.swift in Sources */, + 7CFEB3863F8BB185CD0E835E302E229C /* UISideMenuNavigationController.swift in Sources */, + 40D0942A4F043C8F32E46B87F2567931 /* UITableViewVibrantCell.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 4782265D5F020DE7CABBF410B06DD15B /* Sources */ = { + CD15CD366C008017070A90DB00FD7460 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 7F8EFBD376892EC0F8013FB380642EDD /* Pods-Example-ExampleTests-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - DDC7C7FE5A287037FC683859DCEEBF69 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - B1EEEB049B4B68A2F30FD7E723AC8CAA /* Pods-Example-dummy.m in Sources */, + F4D3A1493EDF1ABBB874672FCC974995 /* Pods-Example-dummy.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 23F5F055342FBD9B1613BBEC36B347AD /* PBXTargetDependency */ = { + 898FCFE56243007FF98ADED3D761336D /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = SideMenu; - target = 88B64A039CB85A823B85B2EF1C336387 /* SideMenu */; - targetProxy = 9990A5EC46C331A7DBA54540D40C9C65 /* PBXContainerItemProxy */; - }; - 25DFFD34259255CE6E4D22BC68A7080D /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = SideMenu; - target = 88B64A039CB85A823B85B2EF1C336387 /* SideMenu */; - targetProxy = 13F1E8AC3A9E5CE2BBE7D8ECE1C25B5A /* PBXContainerItemProxy */; + target = C20E4A286FAAC9347B13B07AE3AB4408 /* SideMenu */; + targetProxy = F0BB12FC8831738F67A75ACD3F75E763 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 015A368F878AC3E2CEAE21DDE8026304 /* Debug */ = { + 11D027BD8219E71225D197BACF78F7C1 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; @@ -423,17 +370,18 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_REQUIRED = NO; COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -442,47 +390,152 @@ "DEBUG=1", "$(inherited)", ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; - PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; + PRODUCT_NAME = "$(TARGET_NAME)"; STRIP_INSTALLED_PRODUCT = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; SYMROOT = "${SRCROOT}/../build"; }; name = Debug; }; - 119B460C6379DC0B9F5DA73F79469E3D /* Debug */ = { + 249A76545EB3A689D2F4854C5FD6758F /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 08E21DD9D71D075A612385031DC79A22 /* SideMenu.xcconfig */; + baseConfigurationReference = 52EB128553BCCD0A43A7713241401647 /* Pods-Example.debug.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CLANG_ENABLE_OBJC_WEAK = NO; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/SideMenu/SideMenu-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/SideMenu/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-Example/Pods-Example-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-Example/Pods-Example.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 44EB823C6F5B16C4735C63D18911E167 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B5A5215990CD9B9E302D772EF78A87E1 /* Pods-Example.release.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CLANG_ENABLE_OBJC_WEAK = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-Example/Pods-Example-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-Example/Pods-Example.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 45B92A634B57F0834EF64F4352FC2C91 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A41DC801C5F8DBE5C88BD0DB5E6AB40F /* SideMenu.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/SideMenu/SideMenu-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/SideMenu/SideMenu-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MODULEMAP_FILE = "Target Support Files/SideMenu/SideMenu.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_MODULE_NAME = SideMenu; PRODUCT_NAME = SideMenu; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 8DF11AC1CB3B39B186F2E35C86204C4C /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A41DC801C5F8DBE5C88BD0DB5E6AB40F /* SideMenu.xcconfig */; + buildSettings = { + CLANG_ENABLE_OBJC_WEAK = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/SideMenu/SideMenu-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/SideMenu/SideMenu-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/SideMenu/SideMenu.modulemap"; + PRODUCT_MODULE_NAME = SideMenu; + PRODUCT_NAME = SideMenu; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -490,21 +543,24 @@ }; name = Debug; }; - 44CDBB6D11DE06DB64D6268622BDC47E /* Release */ = { + 8FB57296A2B59949708C2B492C4646D5 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; @@ -512,250 +568,66 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "POD_CONFIGURATION_RELEASE=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; STRIP_INSTALLED_PRODUCT = NO; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SYMROOT = "${SRCROOT}/../build"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - A0A389CD540DD0531D51843D564CAE64 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3324698B7EF536D06111969551D7A984 /* Pods-Example.debug.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-Example/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-Example/Pods-Example.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_Example; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - B9D5E08C9A9AE119679A6F9C40A8D29B /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = E84078875951590B4A5503E807E1791E /* Pods-Example.release.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-Example/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-Example/Pods-Example.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_Example; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - C56AB7EA568A9080D9B1267CB3138F63 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7CAC7C8AA53EBC987714BAC240E7DE89 /* Pods-Example-ExampleTests.debug.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-Example-ExampleTests/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_Example_ExampleTests; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - CEA2EE32C66D5EE2FE39FC208761E3B0 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 36CF7D6DA1B99FEA132A604D0BF8FB58 /* Pods-Example-ExampleTests.release.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-Example-ExampleTests/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_Example_ExampleTests; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - E9837B3AB507902F7AEB8E85F71C8F74 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 08E21DD9D71D075A612385031DC79A22 /* SideMenu.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/SideMenu/SideMenu-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/SideMenu/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/SideMenu/SideMenu.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = SideMenu; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; SWIFT_VERSION = 4.2; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; + SYMROOT = "${SRCROOT}/../build"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 0E45F5EFF394BFD1E1C17B47E6B8DD5C /* Build configuration list for PBXNativeTarget "Pods-Example-ExampleTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C56AB7EA568A9080D9B1267CB3138F63 /* Debug */, - CEA2EE32C66D5EE2FE39FC208761E3B0 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( - 015A368F878AC3E2CEAE21DDE8026304 /* Debug */, - 44CDBB6D11DE06DB64D6268622BDC47E /* Release */, + 11D027BD8219E71225D197BACF78F7C1 /* Debug */, + 8FB57296A2B59949708C2B492C4646D5 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 8E99E955CA34AB6CCE699D92A2878C2C /* Build configuration list for PBXNativeTarget "Pods-Example" */ = { + A688B68085115C8E33A7F0F3070A1CB1 /* Build configuration list for PBXNativeTarget "SideMenu" */ = { isa = XCConfigurationList; buildConfigurations = ( - A0A389CD540DD0531D51843D564CAE64 /* Debug */, - B9D5E08C9A9AE119679A6F9C40A8D29B /* Release */, + 8DF11AC1CB3B39B186F2E35C86204C4C /* Debug */, + 45B92A634B57F0834EF64F4352FC2C91 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - E9B38AF86661BDD2119B9A4BC90291A8 /* Build configuration list for PBXNativeTarget "SideMenu" */ = { + B479D8172A397C052E8B14B0683B3BD5 /* Build configuration list for PBXNativeTarget "Pods-Example" */ = { isa = XCConfigurationList; buildConfigurations = ( - 119B460C6379DC0B9F5DA73F79469E3D /* Debug */, - E9837B3AB507902F7AEB8E85F71C8F74 /* Release */, + 249A76545EB3A689D2F4854C5FD6758F /* Debug */, + 44EB823C6F5B16C4735C63D18911E167 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Pods/Target Support Files/Pods-Example-ExampleTests/Info.plist b/Pods/Target Support Files/Pods-Example-ExampleTests/Info.plist deleted file mode 100644 index 2243fe6..0000000 --- a/Pods/Target Support Files/Pods-Example-ExampleTests/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0.0 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - - - diff --git a/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-acknowledgements.markdown b/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-acknowledgements.markdown deleted file mode 100644 index f692dc1..0000000 --- a/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-acknowledgements.markdown +++ /dev/null @@ -1,26 +0,0 @@ -# Acknowledgements -This application makes use of the following third party libraries: - -## SideMenu - -Copyright (c) 2015 Jonathan Kent - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -Generated by CocoaPods - https://cocoapods.org diff --git a/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-acknowledgements.plist b/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-acknowledgements.plist deleted file mode 100644 index 55ba497..0000000 --- a/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-acknowledgements.plist +++ /dev/null @@ -1,58 +0,0 @@ - - - - - PreferenceSpecifiers - - - FooterText - This application makes use of the following third party libraries: - Title - Acknowledgements - Type - PSGroupSpecifier - - - FooterText - Copyright (c) 2015 Jonathan Kent <contact@jonkent.me> - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - License - MIT - Title - SideMenu - Type - PSGroupSpecifier - - - FooterText - Generated by CocoaPods - https://cocoapods.org - Title - - Type - PSGroupSpecifier - - - StringsTable - Acknowledgements - Title - Acknowledgements - - diff --git a/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-dummy.m b/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-dummy.m deleted file mode 100644 index e43dbf0..0000000 --- a/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods_Example_ExampleTests : NSObject -@end -@implementation PodsDummy_Pods_Example_ExampleTests -@end diff --git a/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-frameworks.sh b/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-frameworks.sh deleted file mode 100755 index 336032e..0000000 --- a/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-frameworks.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/sh -set -e - -echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" -mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - -SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" - -install_framework() -{ - if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then - local source="${BUILT_PRODUCTS_DIR}/$1" - elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then - local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" - elif [ -r "$1" ]; then - local source="$1" - fi - - local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - - if [ -L "${source}" ]; then - echo "Symlinked..." - source="$(readlink "${source}")" - fi - - # use filter instead of exclude so missing patterns dont' throw errors - echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" - rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" - - local basename - basename="$(basename -s .framework "$1")" - binary="${destination}/${basename}.framework/${basename}" - if ! [ -r "$binary" ]; then - binary="${destination}/${basename}" - fi - - # Strip invalid architectures so "fat" simulator / device frameworks work on device - if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then - strip_invalid_archs "$binary" - fi - - # Resign the code if required by the build settings to avoid unstable apps - code_sign_if_enabled "${destination}/$(basename "$1")" - - # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. - if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then - local swift_runtime_libs - swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) - for lib in $swift_runtime_libs; do - echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" - rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" - code_sign_if_enabled "${destination}/${lib}" - done - fi -} - -# Signs a framework with the provided identity -code_sign_if_enabled() { - if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then - # Use the current code_sign_identitiy - echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" - /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" - fi -} - -# Strip invalid architectures -strip_invalid_archs() { - binary="$1" - # Get architectures for current file - archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" - stripped="" - for arch in $archs; do - if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then - # Strip non-valid architectures in-place - lipo -remove "$arch" -output "$binary" "$binary" || exit 1 - stripped="$stripped $arch" - fi - done - if [[ "$stripped" ]]; then - echo "Stripped $binary of architectures:$stripped" - fi -} - - -if [[ "$CONFIGURATION" == "Debug" ]]; then - install_framework "$BUILT_PRODUCTS_DIR/SideMenu/SideMenu.framework" -fi -if [[ "$CONFIGURATION" == "Release" ]]; then - install_framework "$BUILT_PRODUCTS_DIR/SideMenu/SideMenu.framework" -fi diff --git a/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-resources.sh b/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-resources.sh deleted file mode 100755 index 25e9d37..0000000 --- a/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-resources.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/sh -set -e - -mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - -RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt -> "$RESOURCES_TO_COPY" - -XCASSET_FILES=() - -case "${TARGETED_DEVICE_FAMILY}" in - 1,2) - TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" - ;; - 1) - TARGET_DEVICE_ARGS="--target-device iphone" - ;; - 2) - TARGET_DEVICE_ARGS="--target-device ipad" - ;; - *) - TARGET_DEVICE_ARGS="--target-device mac" - ;; -esac - -install_resource() -{ - if [[ "$1" = /* ]] ; then - RESOURCE_PATH="$1" - else - RESOURCE_PATH="${PODS_ROOT}/$1" - fi - if [[ ! -e "$RESOURCE_PATH" ]] ; then - cat << EOM -error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. -EOM - exit 1 - fi - case $RESOURCE_PATH in - *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" - ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} - ;; - *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" - ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} - ;; - *.framework) - echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - ;; - *.xcdatamodel) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" - xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" - ;; - *.xcdatamodeld) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" - xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" - ;; - *.xcmappingmodel) - echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" - xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" - ;; - *.xcassets) - ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" - XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") - ;; - *) - echo "$RESOURCE_PATH" - echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" - ;; - esac -} - -mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then - mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi -rm -f "$RESOURCES_TO_COPY" - -if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] -then - # Find all other xcassets (this unfortunately includes those of path pods and other targets). - OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) - while read line; do - if [[ $line != "${PODS_ROOT}*" ]]; then - XCASSET_FILES+=("$line") - fi - done <<<"$OTHER_XCASSETS" - - printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi diff --git a/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-umbrella.h b/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-umbrella.h deleted file mode 100644 index 9413f9a..0000000 --- a/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-umbrella.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - - -FOUNDATION_EXPORT double Pods_Example_ExampleTestsVersionNumber; -FOUNDATION_EXPORT const unsigned char Pods_Example_ExampleTestsVersionString[]; - diff --git a/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests.debug.xcconfig b/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests.debug.xcconfig deleted file mode 100644 index 2cf8fd1..0000000 --- a/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests.debug.xcconfig +++ /dev/null @@ -1,11 +0,0 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES -FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SideMenu" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/SideMenu/SideMenu.framework/Headers" -OTHER_LDFLAGS = $(inherited) -framework "SideMenu" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT}/Pods diff --git a/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests.modulemap b/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests.modulemap deleted file mode 100644 index b59cf1d..0000000 --- a/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module Pods_Example_ExampleTests { - umbrella header "Pods-Example-ExampleTests-umbrella.h" - - export * - module * { export * } -} diff --git a/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests.release.xcconfig b/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests.release.xcconfig deleted file mode 100644 index 2cf8fd1..0000000 --- a/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests.release.xcconfig +++ /dev/null @@ -1,11 +0,0 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES -FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SideMenu" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/SideMenu/SideMenu.framework/Headers" -OTHER_LDFLAGS = $(inherited) -framework "SideMenu" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT}/Pods diff --git a/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh b/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh index 336032e..6fcbfa3 100755 --- a/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh +++ b/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh @@ -1,11 +1,33 @@ #!/bin/sh set -e +set -u +set -o pipefail + +function on_error { + echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" +} +trap 'on_error $LINENO' ERR + +if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then + # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy + # frameworks to, so exit 0 (signalling the script phase was successful). + exit 0 +fi echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" +# Used as a return value for each invocation of `strip_invalid_archs` function. +STRIP_BINARY_RETVAL=0 + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +# Copies and strips a vendored framework install_framework() { if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then @@ -19,19 +41,24 @@ install_framework() local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" if [ -L "${source}" ]; then - echo "Symlinked..." - source="$(readlink "${source}")" + echo "Symlinked..." + source="$(readlink "${source}")" fi - # use filter instead of exclude so missing patterns dont' throw errors - echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" - rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" local basename basename="$(basename -s .framework "$1")" binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then binary="${destination}/${basename}" + elif [ -L "${binary}" ]; then + echo "Destination binary is symlinked..." + dirname="$(dirname "${binary}")" + binary="${dirname}/$(readlink "${binary}")" fi # Strip invalid architectures so "fat" simulator / device frameworks work on device @@ -45,7 +72,7 @@ install_framework() # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then local swift_runtime_libs - swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) for lib in $swift_runtime_libs; do echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" @@ -54,38 +81,83 @@ install_framework() fi } +# Copies and strips a vendored dSYM +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + # Copy the dSYM into a the targets temp dir. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" + + local basename + basename="$(basename -s .framework.dSYM "$source")" + binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then + strip_invalid_archs "$binary" + fi + + if [[ $STRIP_BINARY_RETVAL == 1 ]]; then + # Move the stripped file into its final destination. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" + else + # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. + touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" + fi + fi +} + # Signs a framework with the provided identity code_sign_if_enabled() { - if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then - # Use the current code_sign_identitiy + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identity echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" - /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" fi } # Strip invalid architectures strip_invalid_archs() { binary="$1" - # Get architectures for current file - archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" + # Get architectures for current target binary + binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" + # Intersect them with the architectures we are building for + intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" + # If there are no archs supported by this binary then warn the user + if [[ -z "$intersected_archs" ]]; then + echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." + STRIP_BINARY_RETVAL=0 + return + fi stripped="" - for arch in $archs; do - if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + for arch in $binary_archs; do + if ! [[ "${ARCHS}" == *"$arch"* ]]; then # Strip non-valid architectures in-place - lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + lipo -remove "$arch" -output "$binary" "$binary" stripped="$stripped $arch" fi done if [[ "$stripped" ]]; then echo "Stripped $binary of architectures:$stripped" fi + STRIP_BINARY_RETVAL=1 } if [[ "$CONFIGURATION" == "Debug" ]]; then - install_framework "$BUILT_PRODUCTS_DIR/SideMenu/SideMenu.framework" + install_framework "${BUILT_PRODUCTS_DIR}/SideMenu/SideMenu.framework" fi if [[ "$CONFIGURATION" == "Release" ]]; then - install_framework "$BUILT_PRODUCTS_DIR/SideMenu/SideMenu.framework" + install_framework "${BUILT_PRODUCTS_DIR}/SideMenu/SideMenu.framework" +fi +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait fi diff --git a/Pods/Target Support Files/Pods-Example/Pods-Example-umbrella.h b/Pods/Target Support Files/Pods-Example/Pods-Example-umbrella.h index 200a8e1..ecf498e 100644 --- a/Pods/Target Support Files/Pods-Example/Pods-Example-umbrella.h +++ b/Pods/Target Support Files/Pods-Example/Pods-Example-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig b/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig index 2cf8fd1..0fe7e02 100644 --- a/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig +++ b/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig @@ -1,11 +1,11 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES -FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SideMenu" +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SideMenu" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SideMenu/SideMenu.framework/Headers" LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/SideMenu/SideMenu.framework/Headers" OTHER_LDFLAGS = $(inherited) -framework "SideMenu" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig b/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig index 2cf8fd1..0fe7e02 100644 --- a/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig +++ b/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig @@ -1,11 +1,11 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES -FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SideMenu" +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SideMenu" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SideMenu/SideMenu.framework/Headers" LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/SideMenu/SideMenu.framework/Headers" OTHER_LDFLAGS = $(inherited) -framework "SideMenu" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. PODS_ROOT = ${SRCROOT}/Pods diff --git a/Pods/Target Support Files/SideMenu/SideMenu-prefix.pch b/Pods/Target Support Files/SideMenu/SideMenu-prefix.pch index aa992a4..beb2a24 100644 --- a/Pods/Target Support Files/SideMenu/SideMenu-prefix.pch +++ b/Pods/Target Support Files/SideMenu/SideMenu-prefix.pch @@ -1,4 +1,12 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/Pods/Target Support Files/SideMenu/SideMenu-umbrella.h b/Pods/Target Support Files/SideMenu/SideMenu-umbrella.h index a47caf1..e005106 100644 --- a/Pods/Target Support Files/SideMenu/SideMenu-umbrella.h +++ b/Pods/Target Support Files/SideMenu/SideMenu-umbrella.h @@ -1,5 +1,13 @@ #ifdef __OBJC__ #import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif #endif diff --git a/Pods/Target Support Files/SideMenu/SideMenu.xcconfig b/Pods/Target Support Files/SideMenu/SideMenu.xcconfig index 1b395a8..0652b60 100644 --- a/Pods/Target Support Files/SideMenu/SideMenu.xcconfig +++ b/Pods/Target Support Files/SideMenu/SideMenu.xcconfig @@ -1,9 +1,9 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SideMenu +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SideMenu GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/.. PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} SKIP_INSTALL = YES diff --git a/SideMenu.xcodeproj/project.pbxproj b/SideMenu.xcodeproj/project.pbxproj index d203ed8..8e91fc9 100644 --- a/SideMenu.xcodeproj/project.pbxproj +++ b/SideMenu.xcodeproj/project.pbxproj @@ -15,10 +15,14 @@ 7B48A0F81DCB2518002990A1 /* SideMenuTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B48A0F51DCB2518002990A1 /* SideMenuTableViewController.swift */; }; 7B552D5D1DCC65830010301C /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7B552D5C1DCC65830010301C /* Launch Screen.storyboard */; }; 7B5FA9B61DCB269700278DF6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7B5FA9B51DCB269700278DF6 /* Main.storyboard */; }; + 842A45B821BE342A00768381 /* Print.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842A45B721BE342A00768381 /* Print.swift */; }; + 842F058D21994F6200558233 /* SideMenuPresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842F058C21994F6100558233 /* SideMenuPresentationController.swift */; }; + 8436EF0F220EE36F00A8861A /* SideMenuInteractionController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8436EF0E220EE36F00A8861A /* SideMenuInteractionController.swift */; }; 8461A2D31E145A08001DA4F8 /* SideMenuManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8461A2CF1E145A08001DA4F8 /* SideMenuManager.swift */; }; - 8461A2D41E145A08001DA4F8 /* SideMenuTransition.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8461A2D01E145A08001DA4F8 /* SideMenuTransition.swift */; }; 8461A2D51E145A08001DA4F8 /* UISideMenuNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8461A2D11E145A08001DA4F8 /* UISideMenuNavigationController.swift */; }; 8461A2D61E145A08001DA4F8 /* UITableViewVibrantCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8461A2D21E145A08001DA4F8 /* UITableViewVibrantCell.swift */; }; + 846B947A21E006BB00D795AA /* SideMenuGestureManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 846B947921E006BB00D795AA /* SideMenuGestureManager.swift */; }; + 848B96482192F10E005E6712 /* SideMenuTransitionController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848B96472192F10E005E6712 /* SideMenuTransitionController.swift */; }; 84B489B51DD469B000D6CB43 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 84B489B21DD469B000D6CB43 /* LICENSE */; }; 84B489B71DD469B000D6CB43 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 84B489B41DD469B000D6CB43 /* README.md */; }; 84B489BA1DD469DA00D6CB43 /* SideMenu.podspec in Resources */ = {isa = PBXBuildFile; fileRef = 84B489B91DD469DA00D6CB43 /* SideMenu.podspec */; }; @@ -43,10 +47,14 @@ 7B552D5C1DCC65830010301C /* Launch Screen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; }; 7B5FA9B51DCB269700278DF6 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; 7B9DC9041DC6E8C1000D4007 /* SideMenu.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SideMenu.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 842A45B721BE342A00768381 /* Print.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Print.swift; path = Pod/Classes/Print.swift; sourceTree = ""; }; + 842F058C21994F6100558233 /* SideMenuPresentationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SideMenuPresentationController.swift; path = Pod/Classes/SideMenuPresentationController.swift; sourceTree = ""; }; + 8436EF0E220EE36F00A8861A /* SideMenuInteractionController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SideMenuInteractionController.swift; path = Pod/Classes/SideMenuInteractionController.swift; sourceTree = ""; }; 8461A2CF1E145A08001DA4F8 /* SideMenuManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SideMenuManager.swift; path = Pod/Classes/SideMenuManager.swift; sourceTree = ""; }; - 8461A2D01E145A08001DA4F8 /* SideMenuTransition.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SideMenuTransition.swift; path = Pod/Classes/SideMenuTransition.swift; sourceTree = ""; }; 8461A2D11E145A08001DA4F8 /* UISideMenuNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UISideMenuNavigationController.swift; path = Pod/Classes/UISideMenuNavigationController.swift; sourceTree = ""; }; 8461A2D21E145A08001DA4F8 /* UITableViewVibrantCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UITableViewVibrantCell.swift; path = Pod/Classes/UITableViewVibrantCell.swift; sourceTree = ""; }; + 846B947921E006BB00D795AA /* SideMenuGestureManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SideMenuGestureManager.swift; path = Pod/Classes/SideMenuGestureManager.swift; sourceTree = ""; }; + 848B96472192F10E005E6712 /* SideMenuTransitionController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SideMenuTransitionController.swift; path = Pod/Classes/SideMenuTransitionController.swift; sourceTree = ""; }; 84B489B21DD469B000D6CB43 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; 84B489B41DD469B000D6CB43 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 84B489B91DD469DA00D6CB43 /* SideMenu.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SideMenu.podspec; sourceTree = ""; }; @@ -86,10 +94,14 @@ 65FF1B3F1DE33097007B0845 /* Source */ = { isa = PBXGroup; children = ( + 842F058C21994F6100558233 /* SideMenuPresentationController.swift */, + 848B96472192F10E005E6712 /* SideMenuTransitionController.swift */, + 846B947921E006BB00D795AA /* SideMenuGestureManager.swift */, 8461A2CF1E145A08001DA4F8 /* SideMenuManager.swift */, - 8461A2D01E145A08001DA4F8 /* SideMenuTransition.swift */, 8461A2D11E145A08001DA4F8 /* UISideMenuNavigationController.swift */, 8461A2D21E145A08001DA4F8 /* UITableViewVibrantCell.swift */, + 8436EF0E220EE36F00A8861A /* SideMenuInteractionController.swift */, + 842A45B721BE342A00768381 /* Print.swift */, 65FF1B3D1DE321D8007B0845 /* SideMenu.h */, ); name = Source; @@ -198,7 +210,6 @@ 7B48A0D01DCB2487002990A1 /* Frameworks */, 7B48A0D11DCB2487002990A1 /* Resources */, 558DEC0A930F44C17D50F99B /* [CP] Embed Pods Frameworks */, - 890CFF790C4292F1DC8AA122 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -299,28 +310,16 @@ files = ( ); inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/SideMenu/SideMenu.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SideMenu.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 890CFF790C4292F1DC8AA122 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; B96CD08B77E6CAC7B3180AE2 /* [CP] Check Pods Manifest.lock */ = { @@ -329,13 +328,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Example-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -357,7 +359,11 @@ buildActionMask = 2147483647; files = ( 8461A2D51E145A08001DA4F8 /* UISideMenuNavigationController.swift in Sources */, - 8461A2D41E145A08001DA4F8 /* SideMenuTransition.swift in Sources */, + 842F058D21994F6200558233 /* SideMenuPresentationController.swift in Sources */, + 842A45B821BE342A00768381 /* Print.swift in Sources */, + 846B947A21E006BB00D795AA /* SideMenuGestureManager.swift in Sources */, + 8436EF0F220EE36F00A8861A /* SideMenuInteractionController.swift in Sources */, + 848B96482192F10E005E6712 /* SideMenuTransitionController.swift in Sources */, 8461A2D61E145A08001DA4F8 /* UITableViewVibrantCell.swift in Sources */, 8461A2D31E145A08001DA4F8 /* SideMenuManager.swift in Sources */, ); diff --git a/SideMenuPresentable.swift b/SideMenuPresentable.swift new file mode 100644 index 0000000..7b1d7b2 --- /dev/null +++ b/SideMenuPresentable.swift @@ -0,0 +1,18 @@ +// +// SideMenuPresentable.swift +// SideMenu +// +// Created by Jon Kent on 12/29/18. +// + +import UIKit + +//typealias SideMenuPresentableController = UIViewController & SideMenuPresentable +// +//public protocol SideMenuPresentable { +// var leftSide: Bool { get } +// var menuPresentStyle: MenuPresentStyle { get } +// var menuWidth: CGFloat { get } +// var menuAlwaysAnimate: Bool { get } +// var menuDismissOnPush: Bool { get } +//}