Compare commits

..

47 Commits

Author SHA1 Message Date
jonkykong 365b01864f README adjustment. 2018-05-23 18:44:05 -07:00
jonkykong 40ba7f335a Updated README and podspec. 2018-05-23 18:40:15 -07:00
jonkykong 32e6097602 Merge branch 'pr/345' into 4.0.0
* pr/345:
  minor change to be compliant with swift 4.1
2018-05-23 18:36:28 -07:00
jonkykong 2820b58e78 Merge tag '3.1.7'
* tag '3.1.7':
  Refactor.
  Refactor.
  Updated example storyboard.
  Upped minimum deployment target.
  Refactor.
  optimize check
  add nil check
  Fixed func hideMenuStart() to avoid problems when mainViewController is released at hideMenuComplete() func
2018-05-23 18:36:00 -07:00
jonkykong 5f0ecdb410 Merge branch 'pr/320' into 3.1.7
* pr/320:
  Refactor.
  optimize check
  add nil check
2018-05-23 18:08:09 -07:00
jonkykong b58e5c0e63 Refactor. 2018-05-23 18:07:55 -07:00
jonkykong 4319029d98 Merge branch 'pr/311' into 3.1.7
* pr/311:
  Refactor.
  Fixed func hideMenuStart() to avoid problems when mainViewController is released at hideMenuComplete() func

# Conflicts:
#	Pod/Classes/SideMenuTransition.swift
2018-05-23 18:03:44 -07:00
jonkykong 4b8f65812f Refactor. 2018-05-23 18:02:33 -07:00
jonkykong 86a40d1346 Updated example storyboard. 2018-05-23 17:31:34 -07:00
jonkykong 4e896375f2 Upped minimum deployment target. 2018-05-23 17:05:52 -07:00
jonkykong 6c5469c40c Refactor. 2018-05-21 19:13:55 -07:00
Iosif Moldovan 965531907b minor change to be compliant with swift 4.1 2018-04-03 13:15:50 +03:00
jonkykong 1b6b8c446c Fix for exit gesture cancelling menu taps. 2018-02-20 02:38:33 -08:00
Peter Kreinz bcf178c3d5 optimize check 2018-02-05 10:38:38 +01:00
Peter Kreinz 46b4bdc376 add nil check 2018-01-29 17:50:08 +01:00
Jon Kent 175042e238 Update README.md 2018-01-26 11:06:54 -08:00
Jon Kent 2a4d78b7fa Update README.md 2018-01-26 11:05:26 -08:00
Alex Zaragoza 1df40fa25c Fixed func hideMenuStart() to avoid problems when mainViewController is released at hideMenuComplete() func 2018-01-15 14:00:52 +01:00
Jon Kent 8573045525 Update README.md 2018-01-09 02:23:18 -08:00
Jon Kent 9e5b11c1cc Update README.md 2017-12-20 10:00:40 -08:00
Jon Kent ecdbfbb11a Update README.md 2017-12-05 15:44:21 -08:00
Jon Kent 5dc207396f Update README.md 2017-11-21 14:29:57 -08:00
Jon Kent 67886c73a8 Update README.md 2017-11-21 14:29:18 -08:00
jonkykong cbc1ac6624 Update README for Github. 2017-11-21 13:20:38 -08:00
jonkykong 9c7111e7e3 Merge tag '3.1.5'
* tag '3.1.5':
  Updated README requirements.
  Updated README for Cocoapods.
  Exposed defaultManager for Objective-C support.
  Updated podspec.
  Additional changes for objective-C support in UISideMenuNavigationController
  fix objc inference in swift 4
2017-11-21 13:19:21 -08:00
jonkykong df48679df4 Updated README requirements. 2017-11-21 13:15:29 -08:00
jonkykong f32cf72443 Updated README for Cocoapods. 2017-11-21 13:10:30 -08:00
jonkykong b15180fb8a Exposed defaultManager for Objective-C support. 2017-11-21 13:06:57 -08:00
jonkykong 6eae7987ef Updated podspec. 2017-11-21 13:05:03 -08:00
jonkykong c6b7780daf Additional changes for objective-C support in UISideMenuNavigationController 2017-11-21 13:04:52 -08:00
herrernst c54f364d49 fix objc inference in swift 4
in swift 4, swift subclasses of objective-c classes don't export members by default, see https://help.apple.com/xcode/mac/current/#/deve838b19a1
2017-11-07 12:27:45 +01:00
jonkykong 5ac61bc981 Revert README for Cocoapods. 2017-10-31 00:31:17 -07:00
jonkykong b647880794 Merge tag '3.1.4'
* tag '3.1.4':
  Update README for Cocoapods.
  Updated podspec.
  Fixed SideMenu.UISideMenuNavigationController crash on init(nibName:bundle:)
2017-10-31 00:30:51 -07:00
jonkykong 2e684440fc Update README for Cocoapods. 2017-10-31 00:28:19 -07:00
jonkykong 6064d6d5fc Updated podspec. 2017-10-31 00:27:58 -07:00
Lawrence Gimenez d13ed0ea9b Fixed SideMenu.UISideMenuNavigationController crash on init(nibName:bundle:) 2017-10-31 15:06:59 +08:00
jonkykong ef607b3ab2 Update README for Github. 2017-10-28 12:05:27 -07:00
jonkykong 069b974145 Merge tag '3.1.3'
* tag '3.1.3':
  Update README for cocoapods.
  Updated podspec.
  Updated README.
2017-10-28 12:04:53 -07:00
jonkykong 3e452b2a69 Update README for cocoapods. 2017-10-28 11:58:48 -07:00
jonkykong 021fe8cd6a Merge branch 'master' into 3.1.3
* master:
  Exposed delegate to @objc.
  Adding omitted initializer.
  README corrections.
2017-10-28 11:58:01 -07:00
jonkykong fd6ecbbece Updated podspec. 2017-10-28 11:55:43 -07:00
jonkykong 313cda5d69 Updated README. 2017-10-28 11:55:24 -07:00
jonkykong e35a46b075 Exposed delegate to @objc. 2017-10-28 11:52:58 -07:00
jonkykong 3702ecb770 Adding omitted initializer. 2017-10-28 11:52:23 -07:00
jonkykong 893818b582 README corrections. 2017-10-26 18:48:29 -07:00
jonkykong f21ed8965d Revert README for Github. 2017-10-26 18:40:22 -07:00
jonkykong db1cf2a6b6 Merge tag '3.1.2'
* tag '3.1.2':
  Updated podspec.
  Updated README.
  Allow for specifying the sideMenuDelegate, otherwise it discovers it automatically.
  Last commit was incorrect -- but this commit fixes it and includes a work-around for more experience devs who may still want to use default initializer as well as silence some newbie warnings.
  Override of navigation controller default init to prevent new developers from seeing black menus.
  It should be possible now to have the menu slide out even if pushing the new view is not animated itself (animating both can look a bit weird when relying on 'animated' only)
2017-10-26 18:39:49 -07:00
11 changed files with 210 additions and 192 deletions
+32 -35
View File
@@ -1,54 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="8es-i5-QRh">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<!--Navigation Controller-->
<scene sceneID="VDo-YK-ZHx">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<navigationController id="8es-i5-QRh" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" barStyle="black" id="XHs-h3-Wt0">
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<gestureRecognizers/>
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="barTintColor" red="0.25098040700000002" green="0.0" blue="0.50196081400000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</navigationBar>
<connections>
<segue destination="gQC-s5-YYp" kind="relationship" relationship="rootViewController" id="hL1-vz-erR"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Xx8-5L-ee5" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-561" y="336.99999999999994"/>
</scene>
<!--View Controller-->
<scene sceneID="Ksu-iT-xHl">
<objects>
<viewController id="gQC-s5-YYp" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="ZZW-BN-qTx">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright © 2016 Jon Kent. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd">
<rect key="frame" x="20" y="626.5" width="335" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="SideMenu" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
<rect key="frame" x="20" y="202" width="335" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="centerX" secondItem="obG-Y5-kRd" secondAttribute="centerX" id="5cz-MP-9tL"/>
<constraint firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
<constraint firstItem="obG-Y5-kRd" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" constant="20" symbolic="YES" id="SfN-ll-jLj"/>
<constraint firstAttribute="bottom" secondItem="obG-Y5-kRd" secondAttribute="bottom" constant="20" id="Y44-ml-fuU"/>
<constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
<constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" constant="20" symbolic="YES" id="x7j-FC-K8j"/>
</constraints>
<viewLayoutGuide key="safeArea" id="Z5N-rE-oLS"/>
</view>
<navigationItem key="navigationItem" id="NJs-Nl-tMd">
<barButtonItem key="backBarButtonItem" title=" " id="Z6X-gi-A0H"/>
</navigationItem>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="rlc-KC-ZA1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
<point key="canvasLocation" x="142" y="336"/>
</scene>
</scenes>
</document>
+34 -54
View File
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="yAA-s6-Bam">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="yAA-s6-Bam">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
@@ -33,10 +34,6 @@
<scene sceneID="XZh-dw-B7D">
<objects>
<viewController id="QHN-nZ-kbB" customClass="MainViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Rm7-bv-OCN"/>
<viewControllerLayoutGuide type="bottom" id="LW0-9z-RHu"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="0gg-po-Ih1">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -205,14 +202,15 @@
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="LFJ-SB-Zp9" firstAttribute="leading" secondItem="0gg-po-Ih1" secondAttribute="leading" id="OsA-4z-Y7t"/>
<constraint firstItem="LFJ-SB-Zp9" firstAttribute="leading" secondItem="x7m-y5-rfi" secondAttribute="leading" id="OsA-4z-Y7t"/>
<constraint firstItem="ma4-O6-wOT" firstAttribute="top" secondItem="LFJ-SB-Zp9" secondAttribute="bottom" constant="8" id="UUi-lo-0RA"/>
<constraint firstItem="LFJ-SB-Zp9" firstAttribute="top" secondItem="Rm7-bv-OCN" secondAttribute="bottom" id="W6M-QX-I2w"/>
<constraint firstItem="ma4-O6-wOT" firstAttribute="centerX" secondItem="0gg-po-Ih1" secondAttribute="centerX" id="aia-PT-OH3"/>
<constraint firstItem="LW0-9z-RHu" firstAttribute="top" secondItem="ma4-O6-wOT" secondAttribute="bottom" constant="8" id="d5Q-Sj-0Xz"/>
<constraint firstItem="LFJ-SB-Zp9" firstAttribute="top" secondItem="Rm7-bv-OCN" secondAttribute="bottom" id="ssi-ps-a2k"/>
<constraint firstAttribute="trailing" secondItem="LFJ-SB-Zp9" secondAttribute="trailing" id="t0e-pR-bB1"/>
<constraint firstItem="LFJ-SB-Zp9" firstAttribute="top" secondItem="x7m-y5-rfi" secondAttribute="top" id="W6M-QX-I2w"/>
<constraint firstItem="ma4-O6-wOT" firstAttribute="centerX" secondItem="x7m-y5-rfi" secondAttribute="centerX" id="aia-PT-OH3"/>
<constraint firstItem="x7m-y5-rfi" firstAttribute="bottom" secondItem="ma4-O6-wOT" secondAttribute="bottom" constant="8" id="d5Q-Sj-0Xz"/>
<constraint firstItem="LFJ-SB-Zp9" firstAttribute="top" secondItem="x7m-y5-rfi" secondAttribute="top" id="ssi-ps-a2k"/>
<constraint firstItem="x7m-y5-rfi" firstAttribute="trailing" secondItem="LFJ-SB-Zp9" secondAttribute="trailing" id="t0e-pR-bB1"/>
</constraints>
<viewLayoutGuide key="safeArea" id="x7m-y5-rfi"/>
<variation key="default">
<mask key="constraints">
<exclude reference="ssi-ps-a2k"/>
@@ -291,7 +289,7 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Push View Controller 1" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="4WI-Ed-3Gr">
<rect key="frame" x="15" y="0.0" width="345" height="43.5"/>
<rect key="frame" x="15" y="0.0" width="344" height="43.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -312,7 +310,7 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Push View Controller 2" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="DpJ-hV-lmw">
<rect key="frame" x="15" y="0.0" width="345" height="43.5"/>
<rect key="frame" x="15" y="0.0" width="344" height="43.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -333,7 +331,7 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Push View Controller 3" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="mAf-mx-C48">
<rect key="frame" x="15" y="0.0" width="345" height="43.5"/>
<rect key="frame" x="15" y="0.0" width="344" height="43.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -364,14 +362,11 @@
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="PresentedViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="bCi-eF-6hb"/>
<viewControllerLayoutGuide type="bottom" id="WdI-PK-HMg"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.80000001190000003" green="1" blue="0.40000000600000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="tWG-DO-ZIZ"/>
</view>
<navigationItem key="navigationItem" title="You Can Still Swipe!" id="LXz-Eu-D0y">
<barButtonItem key="backBarButtonItem" title=" " id="igL-eY-0yM"/>
@@ -421,7 +416,7 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Present View Controller 1" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="NLA-8t-ufi">
<rect key="frame" x="15" y="0.0" width="345" height="43.5"/>
<rect key="frame" x="15" y="0.0" width="344" height="43.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -442,7 +437,7 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Present View Controller 2" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="IdU-2D-zHb">
<rect key="frame" x="15" y="0.0" width="345" height="43.5"/>
<rect key="frame" x="15" y="0.0" width="344" height="43.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -463,7 +458,7 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Present View Controller 3" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="6x7-O7-DkG">
<rect key="frame" x="15" y="0.0" width="345" height="43.5"/>
<rect key="frame" x="15" y="0.0" width="344" height="43.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -494,10 +489,6 @@
<scene sceneID="1Bw-F8-wcb">
<objects>
<viewController id="uMV-sw-TbB" customClass="PresentedViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="CUv-pn-QnG"/>
<viewControllerLayoutGuide type="bottom" id="Y6o-PP-5OP"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="087-P6-J9s">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -514,12 +505,13 @@
</subviews>
<color key="backgroundColor" red="0.40000000600000002" green="0.80000001190000003" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="Y6o-PP-5OP" firstAttribute="top" secondItem="TJh-vs-sd4" secondAttribute="bottom" id="4Dc-FA-01g"/>
<constraint firstItem="TJh-vs-sd4" firstAttribute="top" secondItem="CUv-pn-QnG" secondAttribute="bottom" id="JJZ-xG-7d7"/>
<constraint firstItem="TSP-pU-CHw" firstAttribute="bottom" secondItem="TJh-vs-sd4" secondAttribute="bottom" id="4Dc-FA-01g"/>
<constraint firstItem="TJh-vs-sd4" firstAttribute="top" secondItem="TSP-pU-CHw" secondAttribute="top" id="JJZ-xG-7d7"/>
<constraint firstItem="TJh-vs-sd4" firstAttribute="top" secondItem="087-P6-J9s" secondAttribute="top" id="UJb-lR-QB7"/>
<constraint firstItem="TJh-vs-sd4" firstAttribute="leading" secondItem="087-P6-J9s" secondAttribute="leading" id="WfV-Kk-KZn"/>
<constraint firstAttribute="trailing" secondItem="TJh-vs-sd4" secondAttribute="trailing" id="nDl-ag-4Xh"/>
<constraint firstItem="TJh-vs-sd4" firstAttribute="leading" secondItem="TSP-pU-CHw" secondAttribute="leading" id="WfV-Kk-KZn"/>
<constraint firstItem="TSP-pU-CHw" firstAttribute="trailing" secondItem="TJh-vs-sd4" secondAttribute="trailing" id="nDl-ag-4Xh"/>
</constraints>
<viewLayoutGuide key="safeArea" id="TSP-pU-CHw"/>
<variation key="default">
<mask key="constraints">
<exclude reference="JJZ-xG-7d7"/>
@@ -536,10 +528,6 @@
<scene sceneID="afw-j1-hgm">
<objects>
<viewController id="Upx-FH-Mbv" customClass="PresentedViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="o4B-82-huU"/>
<viewControllerLayoutGuide type="bottom" id="Cg1-5G-fVh"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="efR-Hd-Gxy">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -557,11 +545,12 @@
<color key="backgroundColor" red="0.40000000600000002" green="0.40000000600000002" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="cKk-fD-whk" firstAttribute="top" secondItem="efR-Hd-Gxy" secondAttribute="top" id="14o-4k-9wZ"/>
<constraint firstItem="cKk-fD-whk" firstAttribute="leading" secondItem="efR-Hd-Gxy" secondAttribute="leading" id="BI7-Em-0rv"/>
<constraint firstItem="cKk-fD-whk" firstAttribute="top" secondItem="o4B-82-huU" secondAttribute="bottom" id="c7O-I7-GYg"/>
<constraint firstAttribute="trailing" secondItem="cKk-fD-whk" secondAttribute="trailing" id="cQ8-xJ-kZK"/>
<constraint firstItem="Cg1-5G-fVh" firstAttribute="top" secondItem="cKk-fD-whk" secondAttribute="bottom" id="flh-y2-QfX"/>
<constraint firstItem="cKk-fD-whk" firstAttribute="leading" secondItem="BaQ-yt-6sz" secondAttribute="leading" id="BI7-Em-0rv"/>
<constraint firstItem="cKk-fD-whk" firstAttribute="top" secondItem="BaQ-yt-6sz" secondAttribute="top" id="c7O-I7-GYg"/>
<constraint firstItem="BaQ-yt-6sz" firstAttribute="trailing" secondItem="cKk-fD-whk" secondAttribute="trailing" id="cQ8-xJ-kZK"/>
<constraint firstItem="BaQ-yt-6sz" firstAttribute="bottom" secondItem="cKk-fD-whk" secondAttribute="bottom" id="flh-y2-QfX"/>
</constraints>
<viewLayoutGuide key="safeArea" id="BaQ-yt-6sz"/>
<variation key="default">
<mask key="constraints">
<exclude reference="c7O-I7-GYg"/>
@@ -578,10 +567,6 @@
<scene sceneID="lxj-KK-fq7">
<objects>
<viewController id="EG7-2X-5hP" customClass="PresentedViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="hJH-tK-XeV"/>
<viewControllerLayoutGuide type="bottom" id="e3Y-bn-25N"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="vac-ts-bf9">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -598,12 +583,13 @@
</subviews>
<color key="backgroundColor" red="1" green="0.40000000600000002" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="e3Y-bn-25N" firstAttribute="top" secondItem="a17-pq-WAQ" secondAttribute="bottom" id="5xQ-vm-6fc"/>
<constraint firstAttribute="trailing" secondItem="a17-pq-WAQ" secondAttribute="trailing" id="Hxw-zj-3jZ"/>
<constraint firstItem="A8B-VL-gbR" firstAttribute="bottom" secondItem="a17-pq-WAQ" secondAttribute="bottom" id="5xQ-vm-6fc"/>
<constraint firstItem="A8B-VL-gbR" firstAttribute="trailing" secondItem="a17-pq-WAQ" secondAttribute="trailing" id="Hxw-zj-3jZ"/>
<constraint firstItem="a17-pq-WAQ" firstAttribute="top" secondItem="vac-ts-bf9" secondAttribute="topMargin" id="MC9-JY-ajb"/>
<constraint firstItem="a17-pq-WAQ" firstAttribute="leading" secondItem="vac-ts-bf9" secondAttribute="leading" id="v2E-c1-L5X"/>
<constraint firstItem="a17-pq-WAQ" firstAttribute="top" secondItem="hJH-tK-XeV" secondAttribute="bottom" id="zAS-oF-Owc"/>
<constraint firstItem="a17-pq-WAQ" firstAttribute="leading" secondItem="A8B-VL-gbR" secondAttribute="leading" id="v2E-c1-L5X"/>
<constraint firstItem="a17-pq-WAQ" firstAttribute="top" secondItem="A8B-VL-gbR" secondAttribute="top" id="zAS-oF-Owc"/>
</constraints>
<viewLayoutGuide key="safeArea" id="A8B-VL-gbR"/>
<variation key="default">
<mask key="constraints">
<exclude reference="zAS-oF-Owc"/>
@@ -620,14 +606,11 @@
<scene sceneID="6GP-Jo-SOW">
<objects>
<viewController id="u7M-mb-V6o" customClass="PresentedViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="RTd-LU-QPL"/>
<viewControllerLayoutGuide type="bottom" id="MN7-Vy-BNb"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="9Dr-7n-COJ">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="0.80000001190000003" blue="0.40000000600000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="hUi-v8-7VE"/>
</view>
<navigationItem key="navigationItem" title="You Can Still Swipe!" id="I4v-gH-e3M">
<barButtonItem key="backBarButtonItem" title=" " id="csP-tV-uyu"/>
@@ -641,14 +624,11 @@
<scene sceneID="ZQL-2c-L6r">
<objects>
<viewController id="b5t-IX-0yu" customClass="PresentedViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="rfX-xz-c0N"/>
<viewControllerLayoutGuide type="bottom" id="Iuo-on-rwS"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ias-bH-Sau">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="0.40000000600000002" blue="0.40000000600000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="bHF-BB-8F0"/>
</view>
<navigationItem key="navigationItem" title="You Can Still Swipe!" id="VCv-tR-uCt">
<barButtonItem key="backBarButtonItem" title=" " id="Xem-d1-6TQ"/>
+10
View File
@@ -16,6 +16,7 @@
SideMenuManager.menuAddScreenEdgePanGesturesToPresent(toView: self.navigationController!.view)
*/
@objcMembers
open class SideMenuManager : NSObject {
@objc public enum MenuPushStyle : Int {
@@ -132,6 +133,14 @@ open class SideMenuManager : NSObject {
/// Default instance of SideMenuManager.
open static let `default` = SideMenuManager()
/// Default instance of SideMenuManager (objective-C).
open class var defaultManager: SideMenuManager {
get {
return SideMenuManager.default
}
}
internal var transition: SideMenuTransition!
public override init() {
@@ -244,6 +253,7 @@ open class SideMenuManager : NSObject {
if menuEnableSwipeGestures {
let exitPanGesture = UIPanGestureRecognizer()
exitPanGesture.cancelsTouchesInView = false
forMenu.view.addGestureRecognizer(exitPanGesture)
if leftSide {
menuLeftSwipeToDismissGesture = exitPanGesture
+49 -57
View File
@@ -170,10 +170,6 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
let velocity = pan.velocity(in: pan.view!).x * direction
view.transform = transform
if velocity >= 100 || velocity >= -50 && abs(distance) >= 0.5 {
// bug workaround: animation briefly resets after call to finishInteractiveTransition() but before animateTransition completion is called.
if ProcessInfo().operatingSystemVersion.majorVersion == 8 && percentComplete > 1 - CGFloat.ulpOfOne {
update(0.9999)
}
finish()
} else {
cancel()
@@ -205,10 +201,6 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
interactive = false
let velocity = pan.velocity(in: pan.view!).x * direction
if velocity >= 100 || velocity >= -50 && distance >= 0.5 {
// bug workaround: animation briefly resets after call to finishInteractiveTransition() but before animateTransition completion is called.
if ProcessInfo().operatingSystemVersion.majorVersion == 8 && percentComplete > 1 - CGFloat.ulpOfOne {
update(0.9999)
}
finish()
activeGesture = nil
} else {
@@ -223,18 +215,20 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
}
@discardableResult internal func hideMenuStart() -> SideMenuTransition {
let menuView = menuViewController?.view
let mainView = mainViewController?.view
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 ?? 0 // in case status bar height changed
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 ?? 0)
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 {
@@ -246,21 +240,17 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
switch sideMenuManager.menuPresentMode {
case .viewSlideOut:
menuView?.alpha = 1 - sideMenuManager.menuAnimationFadeStrength
menuView?.frame.origin.x = presentDirection == .left ? 0 : (mainView?.frame.width ?? 0) - menuWidth
menuView?.transform = CGAffineTransform(scaleX: sideMenuManager.menuAnimationTransformScaleFactor, y: sideMenuManager.menuAnimationTransformScaleFactor)
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:
menuView?.alpha = 1
menuView?.frame.origin.x = presentDirection == .left ? -menuView!.frame.width : mainView!.frame.width
case .menuSlideIn:
menuView?.alpha = 1
menuView?.frame.origin.x = presentDirection == .left ? -menuView!.frame.width : mainView!.frame.width
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
menuView.alpha = 0
menuView.frame.origin.x = presentDirection == .left ? 0 : mainView.frame.width - menuWidth
}
return self
@@ -290,20 +280,22 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
return self
}
@discardableResult internal func presentMenuStart() -> SideMenuTransition {
let menuView = menuViewController?.view
let mainView = mainViewController?.view
@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
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 ?? 0)
mainView?.bounds.size.height = size.height - max(statusBarOffset, 0)
mainView?.frame.origin.y = 0
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.
@@ -311,36 +303,36 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
statusBarFrame.size.height = statusBarOffset
}
tapView?.transform = .identity
tapView?.bounds = mainView!.bounds
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)
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)
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)
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
mainView.frame.origin.x = 0
}
if sideMenuManager.menuPresentMode != .viewSlideOut {
mainView?.transform = CGAffineTransform(scaleX: sideMenuManager.menuAnimationTransformScaleFactor, y: sideMenuManager.menuAnimationTransformScaleFactor)
mainView.transform = CGAffineTransform(scaleX: sideMenuManager.menuAnimationTransformScaleFactor, y: sideMenuManager.menuAnimationTransformScaleFactor)
if sideMenuManager.menuAnimationTransformScaleFactor > 1 {
tapView?.transform = mainView!.transform
tapView?.transform = mainView.transform
}
mainView?.alpha = 1 - sideMenuManager.menuAnimationFadeStrength
mainView.alpha = 1 - sideMenuManager.menuAnimationFadeStrength
}
return self
@@ -515,7 +507,7 @@ extension SideMenuTransition: UIViewControllerAnimatedTransitioning {
let duration = transitionDuration(using: transitionContext)
if interactive {
UIView.animate(withDuration: duration,
delay: duration, // HACK: If zero, the animation briefly flashes in iOS 11. UIViewPropertyAnimators (iOS 10+) may resolve this.
delay: duration, // HACK: If zero, the animation briefly flashes in iOS 11.
options: .curveLinear,
animations: {
animate()
@@ -7,21 +7,14 @@
import UIKit
public protocol UISideMenuNavigationControllerDelegate: class {
func sideMenuWillAppear(menu: UISideMenuNavigationController, animated: Bool)
func sideMenuDidAppear(menu: UISideMenuNavigationController, animated: Bool)
func sideMenuWillDisappear(menu: UISideMenuNavigationController, animated: Bool)
func sideMenuDidDisappear(menu: UISideMenuNavigationController, animated: Bool)
}
// This makes adherance to the protocol optional:
extension UIViewController {
func sideMenuWillAppear(menu: UISideMenuNavigationController, animated: Bool) {}
func sideMenuDidAppear(menu: UISideMenuNavigationController, animated: Bool) {}
func sideMenuWillDisappear(menu: UISideMenuNavigationController, animated: Bool) {}
func sideMenuDidDisappear(menu: UISideMenuNavigationController, animated: Bool) {}
@objc public protocol UISideMenuNavigationControllerDelegate {
@objc optional func sideMenuWillAppear(menu: UISideMenuNavigationController, animated: Bool)
@objc optional func sideMenuDidAppear(menu: UISideMenuNavigationController, animated: Bool)
@objc optional func sideMenuWillDisappear(menu: UISideMenuNavigationController, animated: Bool)
@objc optional func sideMenuDidDisappear(menu: UISideMenuNavigationController, animated: Bool)
}
@objcMembers
open class UISideMenuNavigationController: UINavigationController {
fileprivate weak var foundDelegate: UISideMenuNavigationControllerDelegate?
@@ -56,7 +49,9 @@ open class UISideMenuNavigationController: UINavigationController {
return sideMenuManager.transition
}
}
weak var sideMenuDelegate: UISideMenuNavigationControllerDelegate?
/// 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 {
@@ -104,6 +99,14 @@ open class UISideMenuNavigationController: UINavigationController {
fatalError("init is not available")
}
public override init(rootViewController: UIViewController) {
super.init(rootViewController: rootViewController)
}
public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
}
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
@@ -134,7 +137,7 @@ open class UISideMenuNavigationController: UINavigationController {
presentingViewController?.view.endEditing(true)
foundDelegate = nil
activeDelegate?.sideMenuWillAppear(menu: self, animated: animated)
activeDelegate?.sideMenuWillAppear?(menu: self, animated: animated)
}
override open func viewDidAppear(_ animated: Bool) {
@@ -150,7 +153,7 @@ open class UISideMenuNavigationController: UINavigationController {
return
}
activeDelegate?.sideMenuDidAppear(menu: self, animated: animated)
activeDelegate?.sideMenuDidAppear?(menu: self, animated: animated)
#if !STFU_SIDEMENU
if topViewController == nil {
@@ -190,16 +193,16 @@ open class UISideMenuNavigationController: UINavigationController {
options: sideMenuManager.menuAnimationOptions,
animations: {
self.transition.hideMenuStart()
self.activeDelegate?.sideMenuWillDisappear(menu: self, animated: animated)
self.activeDelegate?.sideMenuWillDisappear?(menu: self, animated: animated)
}) { (finished) -> Void in
self.activeDelegate?.sideMenuDidDisappear(menu: self, animated: animated)
self.activeDelegate?.sideMenuDidDisappear?(menu: self, animated: animated)
self.view.isHidden = true
}
return
}
activeDelegate?.sideMenuWillDisappear(menu: self, animated: animated)
activeDelegate?.sideMenuWillDisappear?(menu: self, animated: animated)
}
override open func viewDidDisappear(_ animated: Bool) {
@@ -213,7 +216,7 @@ open class UISideMenuNavigationController: UINavigationController {
transition.hideMenuStart().hideMenuComplete()
}
activeDelegate?.sideMenuDidDisappear(menu: self, animated: animated)
activeDelegate?.sideMenuDidDisappear?(menu: self, animated: animated)
// Clear selecton on UITableViewControllers when reappearing using custom transitions
guard let tableViewController = topViewController as? UITableViewController,
@@ -270,7 +273,7 @@ open class UISideMenuNavigationController: UINavigationController {
let animated = animated || sideMenuManager.menuAlwaysAnimate
CATransaction.setCompletionBlock( { () -> Void in
activeDelegate?.sideMenuDidDisappear(menu: self, animated: animated)
activeDelegate?.sideMenuDidDisappear?(menu: self, animated: animated)
if !animated {
self.transition.hideMenuStart().hideMenuComplete()
}
@@ -286,7 +289,7 @@ open class UISideMenuNavigationController: UINavigationController {
initialSpringVelocity: sideMenuManager.menuAnimationInitialSpringVelocity,
options: sideMenuManager.menuAnimationOptions,
animations: {
activeDelegate?.sideMenuWillDisappear(menu: self, animated: animated)
activeDelegate?.sideMenuWillDisappear?(menu: self, animated: animated)
self.transition.hideMenuStart()
})
UIView.setAnimationsEnabled(areAnimationsEnabled)
+5 -1
View File
@@ -328,7 +328,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 0930;
};
buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */;
compatibilityVersion = "Xcode 3.2";
@@ -409,12 +409,14 @@
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_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
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_RANGE_LOOP_ANALYSIS = YES;
@@ -496,12 +498,14 @@
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_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
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_RANGE_LOOP_ANALYSIS = YES;
+38 -16
View File
@@ -1,8 +1,11 @@
# ▤ SideMenu
[![Version](https://img.shields.io/cocoapods/v/SideMenu.svg?style=flat)](http://cocoapods.org/pods/SideMenu)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![License](https://img.shields.io/cocoapods/l/SideMenu.svg?style=flat)](http://cocoapods.org/pods/SideMenu)
[![Platform](https://img.shields.io/cocoapods/p/SideMenu.svg?style=flat)](http://cocoapods.org/pods/SideMenu)
[![Version](https://img.shields.io/cocoapods/v/SideMenu.svg?style=flat-square)](http://cocoapods.org/pods/SideMenu)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat-square)](https://github.com/Carthage/Carthage)
[![License](https://img.shields.io/cocoapods/l/SideMenu.svg?style=flat-square)](http://cocoapods.org/pods/SideMenu)
[![Platform](https://img.shields.io/cocoapods/p/SideMenu.svg?style=flat-square)](http://cocoapods.org/pods/SideMenu)
[![Total Downloads](https://img.shields.io/cocoapods/dt/SideMenu.svg?style=social)](http://cocoapods.org/pods/SideMenu)
[![Monthly Downloads](https://img.shields.io/cocoapods/dm/SideMenu.svg?style=social)](http://cocoapods.org/pods/SideMenu)
[![Weekly Downloads](https://img.shields.io/cocoapods/dw/SideMenu.svg?style=social)](http://cocoapods.org/pods/SideMenu)
### If you like SideMenu, give it a ★ at the top right of its [GitHub](https://github.com/jonkykong/SideMenu) page.
#### Using SideMenu in your app? [Send](mailto:yo@massappeal.co?subject=SideMenu%20in%20action!) me a link to your app in the app store!
@@ -10,7 +13,25 @@
> Hi, I'm Jon Kent and I am an iOS designer, developer, and mobile strategist. I love coffee and play the drums.
> * [**Hire me**](mailto:yo@massappeal.co?subject=Let's%20build%20something%20amazing) to help you make cool stuff. *Note: If you're having a problem with SideMenu, please open an [issue](https://github.com/jonkykong/SideMenu/issues/new) and do not email me.*
> * Check out my [website](http://massappeal.co) to see some of my other projects.
> * Building and maintaining this free library takes time. Help keep me awake and buy me a coffee ☕️ via [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=contact%40jonkent%2eme&lc=US&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted).
> * Building and maintaining this **free** library takes a lot of my time and **saves you time**. Please consider paying it forward by supporting me with a small amount to my [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=contact%40jonkent%2eme&lc=US&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted). (only **2** people have donated since inception 😕 but **thank you** to those who have!)
* **[Overview](#overview)**
* [Preview Samples](#preview-samples)
* **[Requirements](#requirements)**
* **[Installation](#installation)**
* [CocoaPods](#cocoapods)
* [Carthage](#carthage)
* **[Usage](#usage)**
* [Code-less Storyboard Implementation](#code-less-storyboard-implementation)
* [Code Implementation](#code-implementation)
* **[Customization](#customization)**
* [SideMenuManager](#sidemenumanager)
* [UISideMenuNavigationController](#uisidemenunavigationcontroller)
* [UISideMenuNavigationControllerDelegate](#uisidemenunavigationcontrollerdelegate)
* [Advanced](#advanced)
* [Known Issues](#known-issues)
* [Thank You](#thank-you)
* [License](#license)
## Overview
@@ -28,10 +49,11 @@ Check out the example project to see it in action!
### Preview Samples
| Slide Out | Slide In | Dissolve | Slide In + Out |
| --- | --- | --- | --- |
| ![](etc/SlideOut.gif) | ![](etc/SlideIn.gif) | ![](etc/Dissolve.gif) | ![](etc/InOut.gif) |
| ![](https://raw.githubusercontent.com/jonkykong/SideMenu/master/etc/SlideOut.gif) | ![](https://raw.githubusercontent.com/jonkykong/SideMenu/master/etc/SlideIn.gif) | ![](https://raw.githubusercontent.com/jonkykong/SideMenu/master/etc/Dissolve.gif) | ![](https://raw.githubusercontent.com/jonkykong/SideMenu/master/etc/InOut.gif) |
## Requirements
- [x] iOS 8 or higher.
- [x] Xcode 9.
- [x] iOS 9 or higher.
## Installation
### CocoaPods
@@ -52,7 +74,7 @@ use_frameworks!
pod 'SideMenu'
# For Swift 3 (no longer maintained), use:
# pod 'SideMenu', '~> 2.3.4'
# pod 'SideMenu', '~> 3.1.7'
```
Then, run the following command:
@@ -81,13 +103,13 @@ github "jonkykong/SideMenu" "master"
## Usage
### Code-less Storyboard Implementation
1. Create a Navigation Controller for a side menu. Set the `Custom Class` of the Navigation Controller to be `UISideMenuNavigationController` in the **Identity Inspector**. Set the `Module` to `SideMenu` (ignore this step if you've manually added SideMenu to your project). Create a Root View Controller for the Navigation Controller (shown as a UITableViewController below). Set up any Triggered Segues you want in that view controller.
![](etc/Screenshot1.png)
![](https://raw.githubusercontent.com/jonkykong/SideMenu/master/etc/Screenshot1.png)
2. Set the `Left Side` property of the `UISideMenuNavigationController` to On if you want it to appear from the left side of the screen, or Off/Default if you want it to appear from the right side.
![](etc/Screenshot2.png)
![](https://raw.githubusercontent.com/jonkykong/SideMenu/master/etc/Screenshot2.png)
3. Add a UIButton or UIBarButton to a view controller that you want to display the menu from. Set that button's Triggered Segues action to modally present the Navigation Controller from step 1.
![](etc/Screenshot3.png)
![](https://raw.githubusercontent.com/jonkykong/SideMenu/master/etc/Screenshot3.png)
That's it. *Note: you can only enable gestures in code.*
### Code Implementation
@@ -126,7 +148,7 @@ dismiss(animated: true, completion: nil)
That's it.
### Customization
#### SideMenuManager
Just type ` SideMenuManager.default.menu...` and code completion will show you everything you can customize (defaults are shown below for reference):
Just type ` SideMenuManager.default.menu...` and code completion will show you everything you can customize (for Objective-C, use `SideMenuManager.defaultManager.menu...`). Defaults values are shown below for reference:
``` swift
/**
The push style of the menu.
@@ -136,7 +158,7 @@ There are six modes in MenuPushStyle:
- 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..
- 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
@@ -224,8 +246,8 @@ of the view controller being presented in storyboard or during its initalization
*/
open var menuDismissOnPush = true
/// Uses the menu dismiss animation even if pushing a view is not animated itself.
open var menuAnimateDismissOnNonAnimatedPush = false
/// Forces menus to always animate when appearing or disappearing, regardless of a pushed view controller's animation.
open var menuAlwaysAnimate = false
/**
The blur effect style of the menu if the menu's root view controller is a UITableViewController or UICollectionViewController.
@@ -297,7 +319,7 @@ extension MyViewController: UISideMenuNavigationControllerDelegate {
}
```
*Note: there is no `delegate` property to set on the `UISideMenuNavigationController` for this to work. If your view controller adheres to the protocol then the methods will be called automatically.*
*Note: setting the `sideMenuDelegate` property on `UISideMenuNavigationController` is optional. If your view controller adheres to the protocol then the methods will be called automatically.*
### Advanced
For simplicity, `SideMenuManager.default` serves as the primary instance as most projects will only need one menu across all screens. If you need to show a different SideMenu, such as from a modal view controller presented from a previous SideMenu, do the following:
1. Declare a variable containing your custom `SideMenuManager` instance. You may want it to define it globally and configure it in your app delegate if menus will be used on multiple screens.
+1 -1
View File
@@ -8,7 +8,7 @@
Pod::Spec.new do |s|
s.name = "SideMenu"
s.version = "3.1.2"
s.version = "4.0.0"
s.summary = "Simple side menu control for iOS in Swift inspired by Facebook. Right and Left sides. No coding required."
# This description is used to generate tags and improve search results.
+7 -3
View File
@@ -279,7 +279,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0800;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = jonkykong;
TargetAttributes = {
7B48A0D21DCB2487002990A1 = {
@@ -556,6 +556,7 @@
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_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
@@ -563,6 +564,7 @@
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
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_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -591,7 +593,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@@ -616,6 +618,7 @@
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_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
@@ -623,6 +626,7 @@
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
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_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -645,7 +649,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
@@ -37,7 +36,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>