Compare commits
108 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8c0ef63ee1 | |||
| 1ebd491f04 | |||
| ad9fa96e33 | |||
| a2370c8cb4 | |||
| 8f995c2bc6 | |||
| 202289d5c6 | |||
| f71245ed75 | |||
| ba3703abda | |||
| 613fd9f68a | |||
| cb89d98dd8 | |||
| 419eabb79d | |||
| fee9c3cb20 | |||
| cc436ded70 | |||
| aeaeba35ac | |||
| 51576e149d | |||
| 5f27a26c13 | |||
| 0ff87874f6 | |||
| 83f8e461e1 | |||
| 40e8408ce1 | |||
| f66a3068b6 | |||
| 40ba7f335a | |||
| 32e6097602 | |||
| 2820b58e78 | |||
| 5f0ecdb410 | |||
| b58e5c0e63 | |||
| 4319029d98 | |||
| 4b8f65812f | |||
| 86a40d1346 | |||
| 4e896375f2 | |||
| 6c5469c40c | |||
| 965531907b | |||
| 1b6b8c446c | |||
| bcf178c3d5 | |||
| 46b4bdc376 | |||
| 175042e238 | |||
| 2a4d78b7fa | |||
| 1df40fa25c | |||
| 8573045525 | |||
| 9e5b11c1cc | |||
| ecdbfbb11a | |||
| 5dc207396f | |||
| 67886c73a8 | |||
| cbc1ac6624 | |||
| 9c7111e7e3 | |||
| df48679df4 | |||
| f32cf72443 | |||
| b15180fb8a | |||
| 6eae7987ef | |||
| c6b7780daf | |||
| c54f364d49 | |||
| 5ac61bc981 | |||
| b647880794 | |||
| 2e684440fc | |||
| 6064d6d5fc | |||
| d13ed0ea9b | |||
| ef607b3ab2 | |||
| 069b974145 | |||
| 3e452b2a69 | |||
| 021fe8cd6a | |||
| fd6ecbbece | |||
| 313cda5d69 | |||
| e35a46b075 | |||
| 3702ecb770 | |||
| 893818b582 | |||
| f21ed8965d | |||
| db1cf2a6b6 | |||
| a66367d84a | |||
| 5f8bdab1dc | |||
| 86f592a20d | |||
| dd0a14fa61 | |||
| 2ba0ef7453 | |||
| 6f57e37129 | |||
| 2af0d86c97 | |||
| 3dc08de6ec | |||
| 646f2a8094 | |||
| ef867ff2b3 | |||
| 49dd185fa7 | |||
| 6a87536f76 | |||
| a2f299bb5f | |||
| 031f97d770 | |||
| 977f9a5b70 | |||
| 3a14516905 | |||
| ddefba9c87 | |||
| d3f59a45a7 | |||
| 1d2f233e7f | |||
| 2a650bec7f | |||
| a8cb38c798 | |||
| b7386851df | |||
| 6e1cb822bf | |||
| 10197c53cf | |||
| 90e252dc78 | |||
| 553cdeae98 | |||
| 26b26c4862 | |||
| 05f8012c66 | |||
| 45586dd398 | |||
| 92375186c8 | |||
| c63f86feae | |||
| 3e01179dec | |||
| 8a3ebd672e | |||
| c6a04437b6 | |||
| bf241ec554 | |||
| d867a67899 | |||
| 80213f5e88 | |||
| 66cc6cad35 | |||
| db97060777 | |||
| 4d32054356 | |||
| 432dfe988f | |||
| 1e8f091bb0 |
+1
-1
@@ -1 +1 @@
|
||||
3.0
|
||||
4.2
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at yo@massappeal.co. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
@@ -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>
|
||||
|
||||
+38
-58
@@ -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"/>
|
||||
@@ -265,10 +263,10 @@
|
||||
</objects>
|
||||
<point key="canvasLocation" x="961.875" y="8.4507042253521121"/>
|
||||
</scene>
|
||||
<!--Side Menu Table View-->
|
||||
<!--Side Menu Table View Controller-->
|
||||
<scene sceneID="L2w-o7-jEN">
|
||||
<objects>
|
||||
<tableViewController id="V6g-oO-Tbm" customClass="SideMenuTableView" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableViewController id="V6g-oO-Tbm" customClass="SideMenuTableViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" scrollEnabled="NO" dataMode="static" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="Dqh-bs-m2M">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
@@ -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"/>
|
||||
@@ -396,10 +391,10 @@
|
||||
</objects>
|
||||
<point key="canvasLocation" x="961.875" y="698.23943661971828"/>
|
||||
</scene>
|
||||
<!--Side Menu Table View-->
|
||||
<!--Side Menu Table View Controller-->
|
||||
<scene sceneID="l9t-dY-QwR">
|
||||
<objects>
|
||||
<tableViewController id="Ol4-YR-KUL" customClass="SideMenuTableView" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableViewController id="Ol4-YR-KUL" customClass="SideMenuTableViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" scrollEnabled="NO" dataMode="static" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="49z-eA-JB7">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
@@ -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"/>
|
||||
|
||||
@@ -26,47 +26,47 @@ class MainViewController: UIViewController {
|
||||
|
||||
fileprivate func setupSideMenu() {
|
||||
// Define the menus
|
||||
SideMenuManager.menuLeftNavigationController = storyboard!.instantiateViewController(withIdentifier: "LeftMenuNavigationController") as? UISideMenuNavigationController
|
||||
SideMenuManager.menuRightNavigationController = storyboard!.instantiateViewController(withIdentifier: "RightMenuNavigationController") as? UISideMenuNavigationController
|
||||
SideMenuManager.default.menuLeftNavigationController = storyboard!.instantiateViewController(withIdentifier: "LeftMenuNavigationController") as? UISideMenuNavigationController
|
||||
SideMenuManager.default.menuRightNavigationController = storyboard!.instantiateViewController(withIdentifier: "RightMenuNavigationController") as? UISideMenuNavigationController
|
||||
|
||||
// Enable gestures. The left and/or right menus must be set up above for these to work.
|
||||
// Note that these continue to work on the Navigation Controller independent of the View Controller it displays!
|
||||
SideMenuManager.menuAddPanGestureToPresent(toView: self.navigationController!.navigationBar)
|
||||
SideMenuManager.menuAddScreenEdgePanGesturesToPresent(toView: self.navigationController!.view)
|
||||
SideMenuManager.default.menuAddPanGestureToPresent(toView: self.navigationController!.navigationBar)
|
||||
SideMenuManager.default.menuAddScreenEdgePanGesturesToPresent(toView: self.navigationController!.view)
|
||||
|
||||
// Set up a cool background image for demo purposes
|
||||
SideMenuManager.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.menuPresentMode)!
|
||||
presentModeSegmentedControl.selectedSegmentIndex = modes.index(of: SideMenuManager.default.menuPresentMode)!
|
||||
|
||||
let styles:[UIBlurEffectStyle] = [.dark, .light, .extraLight]
|
||||
if let menuBlurEffectStyle = SideMenuManager.menuBlurEffectStyle {
|
||||
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.menuAnimationFadeStrength)
|
||||
shadowOpacitySlider.value = Float(SideMenuManager.menuShadowOpacity)
|
||||
shrinkFactorSlider.value = Float(SideMenuManager.menuAnimationTransformScaleFactor)
|
||||
screenWidthSlider.value = Float(SideMenuManager.menuWidth / view.frame.width)
|
||||
blackOutStatusBar.isOn = SideMenuManager.menuFadeStatusBar
|
||||
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.menuPresentMode = modes[segmentControl.selectedSegmentIndex]
|
||||
SideMenuManager.default.menuPresentMode = modes[segmentControl.selectedSegmentIndex]
|
||||
case blurSegmentControl:
|
||||
if segmentControl.selectedSegmentIndex == 0 {
|
||||
SideMenuManager.menuBlurEffectStyle = nil
|
||||
SideMenuManager.default.menuBlurEffectStyle = nil
|
||||
} else {
|
||||
let styles:[UIBlurEffectStyle] = [.dark, .light, .extraLight]
|
||||
SideMenuManager.menuBlurEffectStyle = styles[segmentControl.selectedSegmentIndex - 1]
|
||||
let styles:[UIBlurEffect.Style] = [.dark, .light, .extraLight]
|
||||
SideMenuManager.default.menuBlurEffectStyle = styles[segmentControl.selectedSegmentIndex - 1]
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
@@ -75,18 +75,39 @@ class MainViewController: UIViewController {
|
||||
@IBAction fileprivate func changeSlider(_ slider: UISlider) {
|
||||
switch slider {
|
||||
case darknessSlider:
|
||||
SideMenuManager.menuAnimationFadeStrength = CGFloat(slider.value)
|
||||
SideMenuManager.default.menuAnimationFadeStrength = CGFloat(slider.value)
|
||||
case shadowOpacitySlider:
|
||||
SideMenuManager.menuShadowOpacity = slider.value
|
||||
SideMenuManager.default.menuShadowOpacity = slider.value
|
||||
case shrinkFactorSlider:
|
||||
SideMenuManager.menuAnimationTransformScaleFactor = CGFloat(slider.value)
|
||||
SideMenuManager.default.menuAnimationTransformScaleFactor = CGFloat(slider.value)
|
||||
case screenWidthSlider:
|
||||
SideMenuManager.menuWidth = view.frame.width * CGFloat(slider.value)
|
||||
SideMenuManager.default.menuWidth = view.frame.width * CGFloat(slider.value)
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
@IBAction fileprivate func changeSwitch(_ switchControl: UISwitch) {
|
||||
SideMenuManager.menuFadeStatusBar = switchControl.isOn
|
||||
SideMenuManager.default.menuFadeStatusBar = switchControl.isOn
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension MainViewController: UISideMenuNavigationControllerDelegate {
|
||||
|
||||
func sideMenuWillAppear(menu: UISideMenuNavigationController, animated: Bool) {
|
||||
print("SideMenu Appearing! (animated: \(animated))")
|
||||
}
|
||||
|
||||
func sideMenuDidAppear(menu: UISideMenuNavigationController, animated: Bool) {
|
||||
print("SideMenu Appeared! (animated: \(animated))")
|
||||
}
|
||||
|
||||
func sideMenuWillDisappear(menu: UISideMenuNavigationController, animated: Bool) {
|
||||
print("SideMenu Disappearing! (animated: \(animated))")
|
||||
}
|
||||
|
||||
func sideMenuDidDisappear(menu: UISideMenuNavigationController, animated: Bool) {
|
||||
print("SideMenu Disappeared! (animated: \(animated))")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
//
|
||||
// SideMenuTableView.swift
|
||||
// SideMenu
|
||||
//
|
||||
// Created by Jon Kent on 4/5/16.
|
||||
// Copyright © 2016 CocoaPods. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import SideMenu
|
||||
|
||||
class SideMenuTableView: UITableViewController {
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
|
||||
print("SideMenu Appearing!")
|
||||
|
||||
// this will be non-nil if a blur effect is applied
|
||||
guard tableView.backgroundView == nil else {
|
||||
return
|
||||
}
|
||||
|
||||
// Set up a cool background image for demo purposes
|
||||
let imageView = UIImageView(image: UIImage(named: "saturn"))
|
||||
imageView.contentMode = .scaleAspectFit
|
||||
imageView.backgroundColor = UIColor.black.withAlphaComponent(0.2)
|
||||
tableView.backgroundView = imageView
|
||||
}
|
||||
|
||||
override func viewDidAppear(_ animated: Bool) {
|
||||
super.viewDidAppear(animated)
|
||||
|
||||
print("SideMenu Appeared!")
|
||||
}
|
||||
|
||||
override func viewWillDisappear(_ animated: Bool) {
|
||||
super.viewWillDisappear(animated)
|
||||
|
||||
print("SideMenu Disappearing!")
|
||||
}
|
||||
|
||||
override func viewDidDisappear(_ animated: Bool) {
|
||||
super.viewDidDisappear(animated)
|
||||
|
||||
print("SideMenu Disappeared!")
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// SideMenuTableViewController.swift
|
||||
// SideMenu
|
||||
//
|
||||
// Created by Jon Kent on 4/5/16.
|
||||
// Copyright © 2016 CocoaPods. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import SideMenu
|
||||
|
||||
class SideMenuTableViewController: UITableViewController {
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
|
||||
// refresh cell blur effect in case it changed
|
||||
tableView.reloadData()
|
||||
|
||||
guard SideMenuManager.default.menuBlurEffectStyle == nil else {
|
||||
return
|
||||
}
|
||||
|
||||
// Set up a cool background image for demo purposes
|
||||
let imageView = UIImageView(image: UIImage(named: "saturn"))
|
||||
imageView.contentMode = .scaleAspectFit
|
||||
imageView.backgroundColor = UIColor.black.withAlphaComponent(0.2)
|
||||
tableView.backgroundView = imageView
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let cell = super.tableView(tableView, cellForRowAt: indexPath) as! UITableViewVibrantCell
|
||||
|
||||
cell.blurEffectStyle = SideMenuManager.default.menuBlurEffectStyle
|
||||
|
||||
return cell
|
||||
}
|
||||
|
||||
}
|
||||
+125
-123
@@ -16,9 +16,10 @@
|
||||
SideMenuManager.menuAddScreenEdgePanGesturesToPresent(toView: self.navigationController!.view)
|
||||
*/
|
||||
|
||||
open class SideMenuManager : NSObject {
|
||||
@objcMembers
|
||||
open class SideMenuManager: NSObject {
|
||||
|
||||
public enum MenuPushStyle : Int {
|
||||
@objc public enum MenuPushStyle: Int {
|
||||
case defaultBehavior,
|
||||
popWhenPossible,
|
||||
replace,
|
||||
@@ -27,7 +28,7 @@ open class SideMenuManager : NSObject {
|
||||
subMenu
|
||||
}
|
||||
|
||||
public enum MenuPresentMode : Int {
|
||||
@objc public enum MenuPresentMode: Int {
|
||||
case menuSlideIn,
|
||||
viewSlideOut,
|
||||
viewSlideInOut,
|
||||
@@ -51,7 +52,7 @@ 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 static var menuPushStyle: MenuPushStyle = .defaultBehavior
|
||||
open var menuPushStyle: MenuPushStyle = .defaultBehavior
|
||||
|
||||
/**
|
||||
The presentation mode of the menu.
|
||||
@@ -62,130 +63,98 @@ open class SideMenuManager : NSObject {
|
||||
- viewSlideInOut: The existing view slides out while the menu slides in.
|
||||
- menuDissolveIn: The menu dissolves in over the existing view controller.
|
||||
*/
|
||||
open static var menuPresentMode: MenuPresentMode = .viewSlideOut
|
||||
open var menuPresentMode: MenuPresentMode = .viewSlideOut
|
||||
|
||||
/// Prevents the same view controller (or a view controller of the same class) from being pushed more than once. Defaults to true.
|
||||
open static var menuAllowPushOfSameClassTwice = true
|
||||
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.
|
||||
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 static var menuWidth: CGFloat = max(round(min((appScreenRect.width), (appScreenRect.height)) * 0.75), 240)
|
||||
open var menuWidth: CGFloat = min(round(min((appScreenRect.width), (appScreenRect.height)) * 0.75), 240)
|
||||
|
||||
/// Duration of the animation when the menu is presented without gestures. Default is 0.35 seconds.
|
||||
open static 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 static 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 static 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 static 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 static 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 static 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 static 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 static 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 static 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 static 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 static var menuParallaxStrength: Int = 0
|
||||
open var menuParallaxStrength: Int = 0
|
||||
|
||||
/// Draws the `menuAnimationBackgroundColor` behind the status bar. Default is true.
|
||||
open static var menuFadeStatusBar = true
|
||||
open var menuFadeStatusBar = true
|
||||
|
||||
/// The animation options when a menu is displayed. Ignored when displayed with a gesture.
|
||||
open static var menuAnimationOptions: UIViewAnimationOptions = .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
|
||||
|
||||
/// The animation spring damping when a menu is displayed. Ignored when displayed with a gesture.
|
||||
open static 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 static 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 static var menuDismissOnPush = true
|
||||
open var menuDismissOnPush = true
|
||||
|
||||
/// -Warning: Deprecated. Use `menuPushStyle = .subMenu` instead.
|
||||
@available(*, deprecated, renamed: "menuPushStyle", message: "Use `menuPushStyle = .subMenu` instead.")
|
||||
open static var menuAllowSubmenus: Bool {
|
||||
get {
|
||||
return menuPushStyle == .subMenu
|
||||
}
|
||||
set {
|
||||
if newValue {
|
||||
menuPushStyle = .subMenu
|
||||
}
|
||||
}
|
||||
/// Forces menus to always animate when appearing or disappearing, regardless of a pushed view controller's animation.
|
||||
open var menuAlwaysAnimate = false
|
||||
|
||||
/// Default instance of SideMenuManager.
|
||||
public static let `default` = SideMenuManager()
|
||||
|
||||
/// Default instance of SideMenuManager (objective-C).
|
||||
open class var defaultManager: SideMenuManager {
|
||||
return SideMenuManager.default
|
||||
}
|
||||
|
||||
/// -Warning: Deprecated. Use `menuPushStyle = .popWhenPossible` instead.
|
||||
@available(*, deprecated, renamed: "menuPushStyle", message: "Use `menuPushStyle = .popWhenPossible` instead.")
|
||||
open static var menuAllowPopIfPossible: Bool {
|
||||
get {
|
||||
return menuPushStyle == .popWhenPossible
|
||||
}
|
||||
set {
|
||||
if newValue {
|
||||
menuPushStyle = .popWhenPossible
|
||||
}
|
||||
}
|
||||
}
|
||||
internal var transition: SideMenuTransition!
|
||||
|
||||
/// -Warning: Deprecated. Use `menuPushStyle = .replace` instead.
|
||||
@available(*, deprecated, renamed: "menuPushStyle", message: "Use `menuPushStyle = .replace` instead.")
|
||||
open static var menuReplaceOnPush: Bool {
|
||||
get {
|
||||
return menuPushStyle == .replace
|
||||
}
|
||||
set {
|
||||
if newValue {
|
||||
menuPushStyle = .replace
|
||||
}
|
||||
}
|
||||
public override init() {
|
||||
super.init()
|
||||
transition = SideMenuTransition(sideMenuManager: self)
|
||||
}
|
||||
|
||||
/// -Warning: Deprecated. Use `menuAnimationTransformScaleFactor` instead.
|
||||
@available(*, deprecated, renamed: "menuAnimationTransformScaleFactor")
|
||||
open static var menuAnimationShrinkStrength: CGFloat {
|
||||
get {
|
||||
return menuAnimationTransformScaleFactor
|
||||
}
|
||||
set {
|
||||
menuAnimationTransformScaleFactor = newValue
|
||||
}
|
||||
}
|
||||
|
||||
// prevent instantiation
|
||||
fileprivate override init() {}
|
||||
|
||||
/**
|
||||
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 static var menuBlurEffectStyle: UIBlurEffectStyle? {
|
||||
open var menuBlurEffectStyle: UIBlurEffect.Style? {
|
||||
didSet {
|
||||
if oldValue != menuBlurEffectStyle {
|
||||
updateMenuBlurIfNecessary()
|
||||
@@ -194,30 +163,40 @@ open class SideMenuManager : NSObject {
|
||||
}
|
||||
|
||||
/// The left menu.
|
||||
open static var menuLeftNavigationController: UISideMenuNavigationController? {
|
||||
open var menuLeftNavigationController: UISideMenuNavigationController? {
|
||||
willSet {
|
||||
if menuLeftNavigationController?.presentingViewController == nil {
|
||||
removeMenuBlurForMenu(menuLeftNavigationController)
|
||||
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.")
|
||||
menuLeftNavigationController = oldValue
|
||||
return
|
||||
}
|
||||
|
||||
setupNavigationController(menuLeftNavigationController, leftSide: true)
|
||||
}
|
||||
}
|
||||
|
||||
/// The right menu.
|
||||
open static var menuRightNavigationController: UISideMenuNavigationController? {
|
||||
open var menuRightNavigationController: UISideMenuNavigationController? {
|
||||
willSet {
|
||||
if menuRightNavigationController?.presentingViewController == nil {
|
||||
removeMenuBlurForMenu(menuRightNavigationController)
|
||||
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.")
|
||||
menuRightNavigationController = oldValue
|
||||
@@ -228,7 +207,7 @@ open class SideMenuManager : NSObject {
|
||||
}
|
||||
|
||||
/// The left menu swipe to dismiss gesture.
|
||||
open static weak var menuLeftSwipeToDismissGesture: UIPanGestureRecognizer? {
|
||||
open weak var menuLeftSwipeToDismissGesture: UIPanGestureRecognizer? {
|
||||
didSet {
|
||||
oldValue?.view?.removeGestureRecognizer(oldValue!)
|
||||
setupGesture(gesture: menuLeftSwipeToDismissGesture)
|
||||
@@ -236,28 +215,46 @@ open class SideMenuManager : NSObject {
|
||||
}
|
||||
|
||||
/// The right menu swipe to dismiss gesture.
|
||||
open static weak var menuRightSwipeToDismissGesture: UIPanGestureRecognizer? {
|
||||
open weak var menuRightSwipeToDismissGesture: UIPanGestureRecognizer? {
|
||||
didSet {
|
||||
oldValue?.view?.removeGestureRecognizer(oldValue!)
|
||||
setupGesture(gesture: menuRightSwipeToDismissGesture)
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate class func setupGesture(gesture: UIPanGestureRecognizer?) {
|
||||
fileprivate func setupGesture(gesture: UIPanGestureRecognizer?) {
|
||||
guard let gesture = gesture else {
|
||||
return
|
||||
}
|
||||
|
||||
gesture.addTarget(SideMenuTransition.self, action:#selector(SideMenuTransition.handleHideMenuPan(_:)))
|
||||
gesture.addTarget(transition, action:#selector(SideMenuTransition.handleHideMenuPan(_:)))
|
||||
}
|
||||
|
||||
fileprivate class func setupNavigationController(_ forMenu: UISideMenuNavigationController?, leftSide: Bool) {
|
||||
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
|
||||
@@ -265,14 +262,15 @@ open class SideMenuManager : NSObject {
|
||||
menuRightSwipeToDismissGesture = exitPanGesture
|
||||
}
|
||||
}
|
||||
forMenu.transitioningDelegate = SideMenuTransition.singleton
|
||||
forMenu.modalPresentationStyle = .overFullScreen
|
||||
forMenu.leftSide = leftSide
|
||||
|
||||
// Ensures minimal lag when revealing the menu for the first time using gestures by loading the view:
|
||||
let _ = forMenu.topViewController?.view
|
||||
|
||||
updateMenuBlurIfNecessary()
|
||||
}
|
||||
|
||||
/// Enable or disable gestures that would swipe to dismiss the menu. Default is true.
|
||||
open static var menuEnableSwipeGestures: Bool = true {
|
||||
open var menuEnableSwipeGestures: Bool = true {
|
||||
didSet {
|
||||
menuLeftSwipeToDismissGesture?.view?.removeGestureRecognizer(menuLeftSwipeToDismissGesture!)
|
||||
menuRightSwipeToDismissGesture?.view?.removeGestureRecognizer(menuRightSwipeToDismissGesture!)
|
||||
@@ -281,24 +279,22 @@ open class SideMenuManager : NSObject {
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate class func updateMenuBlurIfNecessary() {
|
||||
let menuBlurBlock = { (forMenu: UISideMenuNavigationController?) in
|
||||
if let forMenu = forMenu {
|
||||
setupMenuBlurForMenu(forMenu)
|
||||
}
|
||||
fileprivate func updateMenuBlurIfNecessary() {
|
||||
if let menuLeftNavigationController = self.menuLeftNavigationController {
|
||||
setupMenuBlurForMenu(menuLeftNavigationController)
|
||||
}
|
||||
if let menuRightNavigationController = self.menuRightNavigationController {
|
||||
setupMenuBlurForMenu(menuRightNavigationController)
|
||||
}
|
||||
|
||||
menuBlurBlock(menuLeftNavigationController)
|
||||
menuBlurBlock(menuRightNavigationController)
|
||||
}
|
||||
|
||||
fileprivate class func setupMenuBlurForMenu(_ forMenu: UISideMenuNavigationController?) {
|
||||
fileprivate func setupMenuBlurForMenu(_ forMenu: UISideMenuNavigationController?) {
|
||||
removeMenuBlurForMenu(forMenu)
|
||||
|
||||
guard let forMenu = forMenu,
|
||||
let menuBlurEffectStyle = menuBlurEffectStyle,
|
||||
let view = forMenu.visibleViewController?.view
|
||||
, !UIAccessibilityIsReduceTransparencyEnabled() else {
|
||||
let view = forMenu.topViewController?.view,
|
||||
!UIAccessibility.isReduceTransparencyEnabled else {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -309,7 +305,7 @@ open class SideMenuManager : NSObject {
|
||||
let blurEffect = UIBlurEffect(style: menuBlurEffectStyle)
|
||||
let blurView = UIVisualEffectView(effect: blurEffect)
|
||||
view.backgroundColor = UIColor.clear
|
||||
if let tableViewController = forMenu.visibleViewController as? UITableViewController {
|
||||
if let tableViewController = forMenu.topViewController as? UITableViewController {
|
||||
tableViewController.tableView.backgroundView = blurView
|
||||
tableViewController.tableView.separatorEffect = UIVibrancyEffect(blurEffect: blurEffect)
|
||||
tableViewController.tableView.reloadData()
|
||||
@@ -320,17 +316,17 @@ open class SideMenuManager : NSObject {
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate class func removeMenuBlurForMenu(_ forMenu: UISideMenuNavigationController?) {
|
||||
fileprivate func removeMenuBlurForMenu(_ forMenu: UISideMenuNavigationController?) {
|
||||
guard let forMenu = forMenu,
|
||||
let originalMenuBackgroundColor = forMenu.originalMenuBackgroundColor,
|
||||
let view = forMenu.visibleViewController?.view else {
|
||||
let view = forMenu.topViewController?.view else {
|
||||
return
|
||||
}
|
||||
|
||||
view.backgroundColor = originalMenuBackgroundColor
|
||||
forMenu.originalMenuBackgroundColor = nil
|
||||
|
||||
if let tableViewController = forMenu.visibleViewController as? UITableViewController {
|
||||
if let tableViewController = forMenu.topViewController as? UITableViewController {
|
||||
tableViewController.tableView.backgroundView = nil
|
||||
tableViewController.tableView.separatorEffect = nil
|
||||
tableViewController.tableView.reloadData()
|
||||
@@ -347,33 +343,39 @@ open class SideMenuManager : NSObject {
|
||||
|
||||
- Returns: The array of screen edge gestures added to `toView`.
|
||||
*/
|
||||
@discardableResult open class func menuAddScreenEdgePanGesturesToPresent(toView: UIView, forMenu:UIRectEdge? = nil) -> [UIScreenEdgePanGestureRecognizer] {
|
||||
@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 = UIScreenEdgePanGestureRecognizer()
|
||||
leftScreenEdgeGestureRecognizer.addTarget(SideMenuTransition.self, action:#selector(SideMenuTransition.handlePresentMenuLeftScreenEdge(_:)))
|
||||
let leftScreenEdgeGestureRecognizer = newScreenEdgeGesture()
|
||||
leftScreenEdgeGestureRecognizer.addTarget(transition, action:#selector(SideMenuTransition.handlePresentMenuLeftScreenEdge(_:)))
|
||||
leftScreenEdgeGestureRecognizer.edges = .left
|
||||
leftScreenEdgeGestureRecognizer.cancelsTouchesInView = true
|
||||
toView.addGestureRecognizer(leftScreenEdgeGestureRecognizer)
|
||||
array.append(leftScreenEdgeGestureRecognizer)
|
||||
|
||||
if SideMenuManager.menuLeftNavigationController == nil {
|
||||
print("SideMenu Warning: menuAddScreenEdgePanGesturesToPresent for the left side was called before menuLeftNavigationController has been defined. The gesture will not work without a menu.")
|
||||
#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.")
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if forMenu != .left {
|
||||
let rightScreenEdgeGestureRecognizer = UIScreenEdgePanGestureRecognizer()
|
||||
rightScreenEdgeGestureRecognizer.addTarget(SideMenuTransition.self, action:#selector(SideMenuTransition.handlePresentMenuRightScreenEdge(_:)))
|
||||
let rightScreenEdgeGestureRecognizer = newScreenEdgeGesture()
|
||||
rightScreenEdgeGestureRecognizer.addTarget(transition, action:#selector(SideMenuTransition.handlePresentMenuRightScreenEdge(_:)))
|
||||
rightScreenEdgeGestureRecognizer.edges = .right
|
||||
rightScreenEdgeGestureRecognizer.cancelsTouchesInView = true
|
||||
toView.addGestureRecognizer(rightScreenEdgeGestureRecognizer)
|
||||
array.append(rightScreenEdgeGestureRecognizer)
|
||||
|
||||
if SideMenuManager.menuRightNavigationController == nil {
|
||||
print("SideMenu Warning: menuAddScreenEdgePanGesturesToPresent for the right side was called before menuRightNavigationController has been defined. The gesture will not work without a menu.")
|
||||
#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
|
||||
@@ -386,12 +388,12 @@ open class SideMenuManager : NSObject {
|
||||
|
||||
- Returns: The pan gesture added to `toView`.
|
||||
*/
|
||||
@discardableResult open class func menuAddPanGestureToPresent(toView: UIView) -> UIPanGestureRecognizer {
|
||||
@discardableResult open func menuAddPanGestureToPresent(toView: UIView) -> UIPanGestureRecognizer {
|
||||
let panGestureRecognizer = UIPanGestureRecognizer()
|
||||
panGestureRecognizer.addTarget(SideMenuTransition.self, action:#selector(SideMenuTransition.handlePresentMenuPan(_:)))
|
||||
panGestureRecognizer.addTarget(transition, action:#selector(SideMenuTransition.handlePresentMenuPan(_:)))
|
||||
toView.addGestureRecognizer(panGestureRecognizer)
|
||||
|
||||
if SideMenuManager.menuLeftNavigationController ?? SideMenuManager.menuRightNavigationController == nil {
|
||||
if menuLeftNavigationController ?? menuRightNavigationController == nil {
|
||||
print("SideMenu Warning: menuAddPanGestureToPresent called before menuLeftNavigationController or menuRightNavigationController have been defined. Gestures will not work without a menu.")
|
||||
}
|
||||
|
||||
|
||||
@@ -12,27 +12,29 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
|
||||
|
||||
fileprivate var presenting = false
|
||||
fileprivate var interactive = false
|
||||
fileprivate static weak var originalSuperview: UIView?
|
||||
fileprivate static weak var activeGesture: UIGestureRecognizer?
|
||||
fileprivate static var switchMenus = false {
|
||||
fileprivate weak var originalSuperview: UIView?
|
||||
fileprivate weak var activeGesture: UIGestureRecognizer?
|
||||
fileprivate var switchMenus = false {
|
||||
didSet {
|
||||
if switchMenus {
|
||||
singleton.cancel()
|
||||
cancel()
|
||||
}
|
||||
}
|
||||
}
|
||||
fileprivate static var menuWidth: CGFloat {
|
||||
get {
|
||||
let overriddenWidth = viewControllerForMenu?.menuWidth ?? 0
|
||||
if overriddenWidth > CGFloat.ulpOfOne {
|
||||
return overriddenWidth
|
||||
}
|
||||
return SideMenuManager.menuWidth
|
||||
fileprivate var menuWidth: CGFloat {
|
||||
let overriddenWidth = menuViewController?.menuWidth ?? 0
|
||||
if overriddenWidth > CGFloat.ulpOfOne {
|
||||
return overriddenWidth
|
||||
}
|
||||
return sideMenuManager.menuWidth
|
||||
}
|
||||
internal static let singleton = SideMenuTransition()
|
||||
internal static var presentDirection: UIRectEdge = .left
|
||||
internal static weak var tapView: UIView? {
|
||||
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
|
||||
@@ -40,76 +42,68 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
|
||||
|
||||
tapView.autoresizingMask = [.flexibleHeight, .flexibleWidth]
|
||||
let exitPanGesture = UIPanGestureRecognizer()
|
||||
exitPanGesture.addTarget(SideMenuTransition.self, action:#selector(SideMenuTransition.handleHideMenuPan(_:)))
|
||||
exitPanGesture.addTarget(self, action:#selector(SideMenuTransition.handleHideMenuPan(_:)))
|
||||
let exitTapGesture = UITapGestureRecognizer()
|
||||
exitTapGesture.addTarget(SideMenuTransition.self, action: #selector(SideMenuTransition.handleHideMenuTap(_:)))
|
||||
exitTapGesture.addTarget(self, action: #selector(SideMenuTransition.handleHideMenuTap(_:)))
|
||||
tapView.addGestureRecognizer(exitPanGesture)
|
||||
tapView.addGestureRecognizer(exitTapGesture)
|
||||
}
|
||||
}
|
||||
internal static weak var statusBarView: UIView? {
|
||||
internal weak var statusBarView: UIView? {
|
||||
didSet {
|
||||
guard let statusBarView = statusBarView else {
|
||||
return
|
||||
}
|
||||
|
||||
statusBarView.backgroundColor = SideMenuManager.menuAnimationBackgroundColor ?? UIColor.black
|
||||
statusBarView.backgroundColor = sideMenuManager.menuAnimationBackgroundColor ?? UIColor.black
|
||||
statusBarView.isUserInteractionEnabled = false
|
||||
}
|
||||
}
|
||||
|
||||
// prevent instantiation
|
||||
fileprivate override init() {
|
||||
required public init(sideMenuManager: SideMenuManager) {
|
||||
super.init()
|
||||
NotificationCenter.default.addObserver(self, selector:#selector(SideMenuTransition.handleNotification), name: NSNotification.Name.UIApplicationDidEnterBackground, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector:#selector(SideMenuTransition.handleNotification), name: NSNotification.Name.UIApplicationWillChangeStatusBarFrame, object: nil)
|
||||
|
||||
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(SideMenuTransition.singleton)
|
||||
NotificationCenter.default.removeObserver(self)
|
||||
}
|
||||
|
||||
fileprivate class var presentingViewControllerForMenu: UIViewController? {
|
||||
get {
|
||||
return SideMenuManager.menuLeftNavigationController?.presentingViewController ?? SideMenuManager.menuRightNavigationController?.presentingViewController
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate class var viewControllerForMenu: UISideMenuNavigationController? {
|
||||
get {
|
||||
return SideMenuTransition.presentDirection == .left ? SideMenuManager.menuLeftNavigationController : SideMenuManager.menuRightNavigationController
|
||||
if let tabBarController = forViewController as? UITabBarController {
|
||||
return getVisibleViewController(forViewController: tabBarController.selectedViewController)
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate class var visibleViewController: UIViewController? {
|
||||
get {
|
||||
return getVisibleViewControllerFromViewController(UIApplication.shared.keyWindow?.rootViewController)
|
||||
if let splitViewController = forViewController as? UISplitViewController {
|
||||
return getVisibleViewController(forViewController: splitViewController.viewControllers.last)
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate class func getVisibleViewControllerFromViewController(_ viewController: UIViewController?) -> UIViewController? {
|
||||
if let navigationController = viewController as? UINavigationController {
|
||||
return getVisibleViewControllerFromViewController(navigationController.visibleViewController)
|
||||
} else if let tabBarController = viewController as? UITabBarController {
|
||||
return getVisibleViewControllerFromViewController(tabBarController.selectedViewController)
|
||||
} else if let presentedViewController = viewController?.presentedViewController {
|
||||
return getVisibleViewControllerFromViewController(presentedViewController)
|
||||
if let presentedViewController = forViewController?.presentedViewController {
|
||||
return getVisibleViewController(forViewController: presentedViewController)
|
||||
}
|
||||
|
||||
return viewController
|
||||
return forViewController
|
||||
}
|
||||
|
||||
@objc internal class func handlePresentMenuLeftScreenEdge(_ edge: UIScreenEdgePanGestureRecognizer) {
|
||||
SideMenuTransition.presentDirection = .left
|
||||
@objc internal func handlePresentMenuLeftScreenEdge(_ edge: UIScreenEdgePanGestureRecognizer) {
|
||||
presentDirection = .left
|
||||
handlePresentMenuPan(edge)
|
||||
}
|
||||
|
||||
@objc internal class func handlePresentMenuRightScreenEdge(_ edge: UIScreenEdgePanGestureRecognizer) {
|
||||
SideMenuTransition.presentDirection = .right
|
||||
@objc internal func handlePresentMenuRightScreenEdge(_ edge: UIScreenEdgePanGestureRecognizer) {
|
||||
presentDirection = .right
|
||||
handlePresentMenuPan(edge)
|
||||
}
|
||||
|
||||
@objc internal class func handlePresentMenuPan(_ pan: UIPanGestureRecognizer) {
|
||||
@objc internal func handlePresentMenuPan(_ pan: UIPanGestureRecognizer) {
|
||||
if activeGesture == nil {
|
||||
activeGesture = pan
|
||||
} else if pan != activeGesture {
|
||||
@@ -121,7 +115,7 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
|
||||
}
|
||||
|
||||
// how much distance have we panned in reference to the parent view?
|
||||
guard let view = presentingViewControllerForMenu?.view ?? pan.view else {
|
||||
guard let view = mainViewController?.view ?? pan.view else {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -131,57 +125,53 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
|
||||
view.transform = transform
|
||||
|
||||
// do some math to translate this to a percentage based value
|
||||
if !singleton.interactive {
|
||||
if !interactive {
|
||||
if translation.x == 0 {
|
||||
return // not sure which way the user is swiping yet, so do nothing
|
||||
}
|
||||
|
||||
if !(pan is UIScreenEdgePanGestureRecognizer) {
|
||||
SideMenuTransition.presentDirection = translation.x > 0 ? .left : .right
|
||||
presentDirection = translation.x > 0 ? .left : .right
|
||||
}
|
||||
|
||||
if let menuViewController = viewControllerForMenu, let visibleViewController = visibleViewController {
|
||||
singleton.interactive = true
|
||||
if let menuViewController = menuViewController, let visibleViewController = SideMenuTransition.visibleViewController {
|
||||
interactive = true
|
||||
visibleViewController.present(menuViewController, animated: true, completion: nil)
|
||||
} else {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
let direction: CGFloat = SideMenuTransition.presentDirection == .left ? 1 : -1
|
||||
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 {
|
||||
singleton.update(min(distance * direction, 1))
|
||||
} else if distance > 0 && SideMenuTransition.presentDirection == .right && SideMenuManager.menuLeftNavigationController != nil {
|
||||
SideMenuTransition.presentDirection = .left
|
||||
update(min(distance * direction, 1))
|
||||
} else if distance > 0 && presentDirection == .right && sideMenuManager.menuLeftNavigationController != nil {
|
||||
presentDirection = .left
|
||||
switchMenus = true
|
||||
} else if distance < 0 && SideMenuTransition.presentDirection == .left && SideMenuManager.menuRightNavigationController != nil {
|
||||
SideMenuTransition.presentDirection = .right
|
||||
} else if distance < 0 && presentDirection == .left && sideMenuManager.menuRightNavigationController != nil {
|
||||
presentDirection = .right
|
||||
switchMenus = true
|
||||
} else {
|
||||
singleton.update(min(distance * direction, 1))
|
||||
update(min(distance * direction, 1))
|
||||
}
|
||||
default:
|
||||
singleton.interactive = false
|
||||
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 {
|
||||
// bug workaround: animation briefly resets after call to finishInteractiveTransition() but before animateTransition completion is called.
|
||||
if ProcessInfo().operatingSystemVersion.majorVersion == 8 && singleton.percentComplete > 1 - CGFloat.ulpOfOne {
|
||||
singleton.update(0.9999)
|
||||
}
|
||||
singleton.finish()
|
||||
finish()
|
||||
} else {
|
||||
singleton.cancel()
|
||||
cancel()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@objc internal class func handleHideMenuPan(_ pan: UIPanGestureRecognizer) {
|
||||
@objc internal func handleHideMenuPan(_ pan: UIPanGestureRecognizer) {
|
||||
if activeGesture == nil {
|
||||
activeGesture = pan
|
||||
} else if pan != activeGesture {
|
||||
@@ -191,216 +181,208 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
|
||||
}
|
||||
|
||||
let translation = pan.translation(in: pan.view!)
|
||||
let direction:CGFloat = SideMenuTransition.presentDirection == .left ? -1 : 1
|
||||
let direction:CGFloat = presentDirection == .left ? -1 : 1
|
||||
let distance = translation.x / menuWidth * direction
|
||||
|
||||
switch (pan.state) {
|
||||
|
||||
case .began:
|
||||
singleton.interactive = true
|
||||
presentingViewControllerForMenu?.dismiss(animated: true, completion: nil)
|
||||
interactive = true
|
||||
mainViewController?.dismiss(animated: true, completion: nil)
|
||||
case .changed:
|
||||
singleton.update(max(min(distance, 1), 0))
|
||||
update(max(min(distance, 1), 0))
|
||||
default:
|
||||
singleton.interactive = false
|
||||
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 && singleton.percentComplete > 1 - CGFloat.ulpOfOne {
|
||||
singleton.update(0.9999)
|
||||
}
|
||||
singleton.finish()
|
||||
finish()
|
||||
activeGesture = nil
|
||||
} else {
|
||||
singleton.cancel()
|
||||
cancel()
|
||||
activeGesture = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@objc internal class func handleHideMenuTap(_ tap: UITapGestureRecognizer) {
|
||||
presentingViewControllerForMenu?.dismiss(animated: true, completion: nil)
|
||||
@objc internal func handleHideMenuTap(_ tap: UITapGestureRecognizer) {
|
||||
menuViewController?.dismiss(animated: true, completion: nil)
|
||||
}
|
||||
|
||||
internal class func hideMenuStart() {
|
||||
guard let mainViewController = presentingViewControllerForMenu,
|
||||
let menuView = SideMenuTransition.presentDirection == .left ? SideMenuManager.menuLeftNavigationController?.view : SideMenuManager.menuRightNavigationController?.view else {
|
||||
return
|
||||
@discardableResult internal func hideMenuStart() -> SideMenuTransition {
|
||||
guard let menuView = menuViewController?.view,
|
||||
let mainView = mainViewController?.view else {
|
||||
return self
|
||||
}
|
||||
|
||||
mainViewController.view.transform = .identity
|
||||
mainViewController.view.alpha = 1
|
||||
mainViewController.view.frame.origin.y = 0
|
||||
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 = mainViewController.view.frame.height // in case status bar height changed
|
||||
menuView.frame.size.height = mainView.frame.height // in case status bar height changed
|
||||
var statusBarFrame = UIApplication.shared.statusBarFrame
|
||||
let statusBarOffset = SideMenuManager.appScreenRect.size.height - mainViewController.view.frame.maxY
|
||||
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
|
||||
}
|
||||
SideMenuTransition.statusBarView?.frame = statusBarFrame
|
||||
SideMenuTransition.statusBarView?.alpha = 0
|
||||
statusBarView?.frame = statusBarFrame
|
||||
statusBarView?.alpha = 0
|
||||
|
||||
switch SideMenuManager.menuPresentMode {
|
||||
switch sideMenuManager.menuPresentMode {
|
||||
|
||||
case .viewSlideOut:
|
||||
menuView.alpha = 1 - SideMenuManager.menuAnimationFadeStrength
|
||||
menuView.frame.origin.x = SideMenuTransition.presentDirection == .left ? 0 : mainViewController.view.frame.width - menuWidth
|
||||
mainViewController.view.frame.origin.x = 0
|
||||
menuView.transform = CGAffineTransform(scaleX: SideMenuManager.menuAnimationTransformScaleFactor, y: SideMenuManager.menuAnimationTransformScaleFactor)
|
||||
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:
|
||||
case .viewSlideInOut, .menuSlideIn:
|
||||
menuView.alpha = 1
|
||||
menuView.frame.origin.x = SideMenuTransition.presentDirection == .left ? -menuView.frame.width : mainViewController.view.frame.width
|
||||
mainViewController.view.frame.origin.x = 0
|
||||
|
||||
case .menuSlideIn:
|
||||
menuView.alpha = 1
|
||||
menuView.frame.origin.x = SideMenuTransition.presentDirection == .left ? -menuView.frame.width : mainViewController.view.frame.width
|
||||
menuView.frame.origin.x = presentDirection == .left ? -menuWidth : mainView.frame.width
|
||||
|
||||
case .menuDissolveIn:
|
||||
menuView.alpha = 0
|
||||
menuView.frame.origin.x = SideMenuTransition.presentDirection == .left ? 0 : mainViewController.view.frame.width - menuWidth
|
||||
mainViewController.view.frame.origin.x = 0
|
||||
menuView.frame.origin.x = presentDirection == .left ? 0 : mainView.frame.width - menuWidth
|
||||
}
|
||||
|
||||
return self
|
||||
}
|
||||
|
||||
internal class func hideMenuComplete() {
|
||||
guard let mainViewController = presentingViewControllerForMenu,
|
||||
let menuView = viewControllerForMenu?.view else {
|
||||
return
|
||||
}
|
||||
@discardableResult internal func hideMenuComplete() -> SideMenuTransition {
|
||||
let menuView = menuViewController?.view
|
||||
let mainView = mainViewController?.view
|
||||
|
||||
SideMenuTransition.tapView?.removeFromSuperview()
|
||||
SideMenuTransition.statusBarView?.removeFromSuperview()
|
||||
mainViewController.view.motionEffects.removeAll()
|
||||
mainViewController.view.layer.shadowOpacity = 0
|
||||
menuView.layer.shadowOpacity = 0
|
||||
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 {
|
||||
originalSuperview.addSubview(mainViewController.view)
|
||||
let y = originalSuperview.bounds.height - mainViewController.view.frame.size.height
|
||||
mainViewController.view.frame.origin.y = max(y, 0)
|
||||
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
|
||||
}
|
||||
|
||||
internal class func presentMenuStart() {
|
||||
guard let menuView = viewControllerForMenu?.view,
|
||||
let mainViewController = presentingViewControllerForMenu else {
|
||||
return
|
||||
@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 = SideMenuTransition.presentDirection == .left ? 0 : size.width - menuWidth
|
||||
mainViewController.view.transform = .identity
|
||||
mainViewController.view.frame.size.width = size.width
|
||||
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
|
||||
mainViewController.view.bounds.size.height = size.height - max(statusBarOffset, 0)
|
||||
mainViewController.view.frame.origin.y = 0
|
||||
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
|
||||
}
|
||||
SideMenuTransition.tapView?.transform = .identity
|
||||
SideMenuTransition.tapView?.bounds = mainViewController.view.bounds
|
||||
SideMenuTransition.statusBarView?.frame = statusBarFrame
|
||||
SideMenuTransition.statusBarView?.alpha = 1
|
||||
tapView?.transform = .identity
|
||||
tapView?.bounds = mainView.bounds
|
||||
statusBarView?.frame = statusBarFrame
|
||||
statusBarView?.alpha = 1
|
||||
|
||||
switch SideMenuManager.menuPresentMode {
|
||||
switch sideMenuManager.menuPresentMode {
|
||||
|
||||
case .viewSlideOut, .viewSlideInOut:
|
||||
mainViewController.view.layer.shadowColor = SideMenuManager.menuShadowColor.cgColor
|
||||
mainViewController.view.layer.shadowRadius = SideMenuManager.menuShadowRadius
|
||||
mainViewController.view.layer.shadowOpacity = SideMenuManager.menuShadowOpacity
|
||||
mainViewController.view.layer.shadowOffset = CGSize(width: 0, height: 0)
|
||||
let direction:CGFloat = SideMenuTransition.presentDirection == .left ? 1 : -1
|
||||
mainViewController.view.frame.origin.x = direction * (menuView.frame.width)
|
||||
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
|
||||
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)
|
||||
}
|
||||
mainViewController.view.frame.origin.x = 0
|
||||
mainView.frame.origin.x = 0
|
||||
}
|
||||
|
||||
if SideMenuManager.menuPresentMode != .viewSlideOut {
|
||||
mainViewController.view.transform = CGAffineTransform(scaleX: SideMenuManager.menuAnimationTransformScaleFactor, y: SideMenuManager.menuAnimationTransformScaleFactor)
|
||||
if SideMenuManager.menuAnimationTransformScaleFactor > 1 {
|
||||
SideMenuTransition.tapView?.transform = mainViewController.view.transform
|
||||
if sideMenuManager.menuPresentMode != .viewSlideOut {
|
||||
mainView.transform = CGAffineTransform(scaleX: sideMenuManager.menuAnimationTransformScaleFactor, y: sideMenuManager.menuAnimationTransformScaleFactor)
|
||||
if sideMenuManager.menuAnimationTransformScaleFactor > 1 {
|
||||
tapView?.transform = mainView.transform
|
||||
}
|
||||
mainViewController.view.alpha = 1 - SideMenuManager.menuAnimationFadeStrength
|
||||
mainView.alpha = 1 - sideMenuManager.menuAnimationFadeStrength
|
||||
}
|
||||
|
||||
return self
|
||||
}
|
||||
|
||||
internal class func presentMenuComplete() {
|
||||
guard let mainViewController = presentingViewControllerForMenu else {
|
||||
return
|
||||
}
|
||||
|
||||
switch SideMenuManager.menuPresentMode {
|
||||
@discardableResult internal func presentMenuComplete() -> SideMenuTransition {
|
||||
switch sideMenuManager.menuPresentMode {
|
||||
case .menuSlideIn, .menuDissolveIn, .viewSlideInOut:
|
||||
if SideMenuManager.menuParallaxStrength != 0 {
|
||||
if let mainView = mainViewController?.view, sideMenuManager.menuParallaxStrength != 0 {
|
||||
let horizontal = UIInterpolatingMotionEffect(keyPath: "center.x", type: .tiltAlongHorizontalAxis)
|
||||
horizontal.minimumRelativeValue = -SideMenuManager.menuParallaxStrength
|
||||
horizontal.maximumRelativeValue = SideMenuManager.menuParallaxStrength
|
||||
horizontal.minimumRelativeValue = -sideMenuManager.menuParallaxStrength
|
||||
horizontal.maximumRelativeValue = sideMenuManager.menuParallaxStrength
|
||||
|
||||
let vertical = UIInterpolatingMotionEffect(keyPath: "center.y", type: .tiltAlongVerticalAxis)
|
||||
vertical.minimumRelativeValue = -SideMenuManager.menuParallaxStrength
|
||||
vertical.maximumRelativeValue = SideMenuManager.menuParallaxStrength
|
||||
vertical.minimumRelativeValue = -sideMenuManager.menuParallaxStrength
|
||||
vertical.maximumRelativeValue = sideMenuManager.menuParallaxStrength
|
||||
|
||||
let group = UIMotionEffectGroup()
|
||||
group.motionEffects = [horizontal, vertical]
|
||||
mainViewController.view.addMotionEffect(group)
|
||||
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 let mainViewController = SideMenuTransition.presentingViewControllerForMenu,
|
||||
let menuViewController = SideMenuTransition.viewControllerForMenu,
|
||||
menuViewController.presentedViewController == nil && menuViewController.presentingViewController != nil else {
|
||||
guard menuViewController?.presentedViewController == nil &&
|
||||
menuViewController?.presentingViewController != nil else {
|
||||
return
|
||||
}
|
||||
|
||||
if let originalSuperview = SideMenuTransition.originalSuperview {
|
||||
if let originalSuperview = originalSuperview, let mainViewController = mainViewController {
|
||||
originalSuperview.addSubview(mainViewController.view)
|
||||
}
|
||||
|
||||
if notification.name == NSNotification.Name.UIApplicationDidEnterBackground {
|
||||
SideMenuTransition.hideMenuStart()
|
||||
SideMenuTransition.hideMenuComplete()
|
||||
menuViewController.dismiss(animated: false, completion: nil)
|
||||
if notification.name == UIApplication.didEnterBackgroundNotification {
|
||||
hideMenuStart().hideMenuComplete()
|
||||
menuViewController?.dismiss(animated: false, completion: nil)
|
||||
return
|
||||
}
|
||||
|
||||
UIView.animate(withDuration: SideMenuManager.menuAnimationDismissDuration,
|
||||
UIView.animate(withDuration: sideMenuManager.menuAnimationDismissDuration,
|
||||
delay: 0,
|
||||
usingSpringWithDamping: SideMenuManager.menuAnimationUsingSpringWithDamping,
|
||||
initialSpringVelocity: SideMenuManager.menuAnimationInitialSpringVelocity,
|
||||
options: SideMenuManager.menuAnimationOptions,
|
||||
usingSpringWithDamping: sideMenuManager.menuAnimationUsingSpringWithDamping,
|
||||
initialSpringVelocity: sideMenuManager.menuAnimationInitialSpringVelocity,
|
||||
options: sideMenuManager.menuAnimationOptions,
|
||||
animations: {
|
||||
SideMenuTransition.hideMenuStart()
|
||||
self.hideMenuStart()
|
||||
}) { (finished) -> Void in
|
||||
SideMenuTransition.hideMenuComplete()
|
||||
menuViewController.dismiss(animated: false, completion: nil)
|
||||
self.hideMenuComplete()
|
||||
self.menuViewController?.dismiss(animated: false, completion: nil)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,13 +392,15 @@ 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 {
|
||||
if let menuBackgroundColor = sideMenuManager.menuAnimationBackgroundColor {
|
||||
container.backgroundColor = menuBackgroundColor
|
||||
}
|
||||
|
||||
@@ -425,18 +409,17 @@ extension SideMenuTransition: UIViewControllerAnimatedTransitioning {
|
||||
|
||||
// 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
|
||||
let menuViewController = presenting ? toViewController : fromViewController
|
||||
let topViewController = presenting ? fromViewController : toViewController
|
||||
mainViewController = presenting ? fromViewController : toViewController
|
||||
|
||||
let menuView = menuViewController.view!
|
||||
let topView = topViewController.view!
|
||||
let menuView = menuViewController!.view!
|
||||
let topView = mainViewController!.view!
|
||||
|
||||
// prepare menu items to slide in
|
||||
if presenting {
|
||||
SideMenuTransition.originalSuperview = topView.superview
|
||||
originalSuperview = topView.superview
|
||||
|
||||
// add the both views to our view controller
|
||||
switch SideMenuManager.menuPresentMode {
|
||||
switch sideMenuManager.menuPresentMode {
|
||||
case .viewSlideOut, .viewSlideInOut:
|
||||
container.addSubview(menuView)
|
||||
container.addSubview(topView)
|
||||
@@ -445,20 +428,20 @@ extension SideMenuTransition: UIViewControllerAnimatedTransitioning {
|
||||
container.addSubview(menuView)
|
||||
}
|
||||
|
||||
if SideMenuManager.menuFadeStatusBar {
|
||||
if sideMenuManager.menuFadeStatusBar {
|
||||
let statusBarView = UIView()
|
||||
SideMenuTransition.statusBarView = statusBarView
|
||||
self.statusBarView = statusBarView
|
||||
container.addSubview(statusBarView)
|
||||
}
|
||||
|
||||
SideMenuTransition.hideMenuStart()
|
||||
hideMenuStart()
|
||||
}
|
||||
|
||||
let animate = {
|
||||
if self.presenting {
|
||||
SideMenuTransition.presentMenuStart()
|
||||
self.presentMenuStart()
|
||||
} else {
|
||||
SideMenuTransition.hideMenuStart()
|
||||
self.hideMenuStart()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -467,51 +450,51 @@ extension SideMenuTransition: UIViewControllerAnimatedTransitioning {
|
||||
|
||||
// tell our transitionContext object that we've finished animating
|
||||
if transitionContext.transitionWasCancelled {
|
||||
let viewControllerForPresentedMenu = SideMenuTransition.presentingViewControllerForMenu
|
||||
let viewControllerForPresentedMenu = self.mainViewController
|
||||
|
||||
if self.presenting {
|
||||
SideMenuTransition.hideMenuComplete()
|
||||
self.hideMenuComplete()
|
||||
} else {
|
||||
SideMenuTransition.presentMenuComplete()
|
||||
self.presentMenuComplete()
|
||||
}
|
||||
|
||||
transitionContext.completeTransition(false)
|
||||
|
||||
if SideMenuTransition.switchMenus {
|
||||
SideMenuTransition.switchMenus = false
|
||||
viewControllerForPresentedMenu?.present(SideMenuTransition.viewControllerForMenu!, animated: true, completion: nil)
|
||||
if self.switchMenus {
|
||||
self.switchMenus = false
|
||||
viewControllerForPresentedMenu?.present(self.menuViewController!, animated: true, completion: nil)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
if self.presenting {
|
||||
SideMenuTransition.presentMenuComplete()
|
||||
self.presentMenuComplete()
|
||||
transitionContext.completeTransition(true)
|
||||
switch SideMenuManager.menuPresentMode {
|
||||
switch self.sideMenuManager.menuPresentMode {
|
||||
case .viewSlideOut, .viewSlideInOut:
|
||||
container.addSubview(topView)
|
||||
case .menuSlideIn, .menuDissolveIn:
|
||||
container.insertSubview(topView, at: 0)
|
||||
}
|
||||
if !SideMenuManager.menuPresentingViewControllerUserInteractionEnabled {
|
||||
if !self.sideMenuManager.menuPresentingViewControllerUserInteractionEnabled {
|
||||
let tapView = UIView()
|
||||
container.insertSubview(tapView, aboveSubview: topView)
|
||||
tapView.bounds = container.bounds
|
||||
tapView.center = topView.center
|
||||
if SideMenuManager.menuAnimationTransformScaleFactor > 1 {
|
||||
if self.sideMenuManager.menuAnimationTransformScaleFactor > 1 {
|
||||
tapView.transform = topView.transform
|
||||
}
|
||||
SideMenuTransition.tapView = tapView
|
||||
self.tapView = tapView
|
||||
}
|
||||
if let statusBarView = SideMenuTransition.statusBarView {
|
||||
container.bringSubview(toFront: statusBarView)
|
||||
if let statusBarView = self.statusBarView {
|
||||
container.bringSubviewToFront(statusBarView)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
SideMenuTransition.hideMenuComplete()
|
||||
self.hideMenuComplete()
|
||||
transitionContext.completeTransition(true)
|
||||
menuView.removeFromSuperview()
|
||||
}
|
||||
@@ -520,7 +503,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()
|
||||
@@ -530,9 +513,9 @@ extension SideMenuTransition: UIViewControllerAnimatedTransitioning {
|
||||
} else {
|
||||
UIView.animate(withDuration: duration,
|
||||
delay: 0,
|
||||
usingSpringWithDamping: SideMenuManager.menuAnimationUsingSpringWithDamping,
|
||||
initialSpringVelocity: SideMenuManager.menuAnimationInitialSpringVelocity,
|
||||
options: SideMenuManager.menuAnimationOptions,
|
||||
usingSpringWithDamping: sideMenuManager.menuAnimationUsingSpringWithDamping,
|
||||
initialSpringVelocity: sideMenuManager.menuAnimationInitialSpringVelocity,
|
||||
options: sideMenuManager.menuAnimationOptions,
|
||||
animations: {
|
||||
animate()
|
||||
}) { (finished) -> Void in
|
||||
@@ -544,18 +527,19 @@ extension SideMenuTransition: UIViewControllerAnimatedTransitioning {
|
||||
// return how many seconds the transiton animation will take
|
||||
open func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
|
||||
if interactive {
|
||||
return SideMenuManager.menuAnimationCompleteGestureDuration
|
||||
return sideMenuManager.menuAnimationCompleteGestureDuration
|
||||
}
|
||||
return presenting ? SideMenuManager.menuAnimationPresentDuration : SideMenuManager.menuAnimationDismissDuration
|
||||
return presenting ? sideMenuManager.menuAnimationPresentDuration : sideMenuManager.menuAnimationDismissDuration
|
||||
}
|
||||
|
||||
open override func update(_ percentComplete: CGFloat) {
|
||||
guard !SideMenuTransition.switchMenus else {
|
||||
guard !switchMenus else {
|
||||
return
|
||||
}
|
||||
|
||||
super.update(percentComplete)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension SideMenuTransition: UIViewControllerTransitioningDelegate {
|
||||
@@ -564,7 +548,7 @@ extension SideMenuTransition: UIViewControllerTransitioningDelegate {
|
||||
// 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
|
||||
SideMenuTransition.presentDirection = presented == SideMenuManager.menuLeftNavigationController ? .left : .right
|
||||
presentDirection = presented == sideMenuManager.menuLeftNavigationController ? .left : .right
|
||||
return self
|
||||
}
|
||||
|
||||
@@ -577,11 +561,11 @@ extension SideMenuTransition: UIViewControllerTransitioningDelegate {
|
||||
open func interactionControllerForPresentation(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? {
|
||||
// if our interactive flag is true, return the transition manager object
|
||||
// otherwise return nil
|
||||
return interactive ? SideMenuTransition.singleton : nil
|
||||
return interactive ? self : nil
|
||||
}
|
||||
|
||||
open func interactionControllerForDismissal(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? {
|
||||
return interactive ? SideMenuTransition.singleton : nil
|
||||
return interactive ? self : nil
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,35 +7,121 @@
|
||||
|
||||
import UIKit
|
||||
|
||||
@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 {
|
||||
|
||||
/// Width of the menu when presented on screen, showing the existing view controller in the remaining space. Default is zero. When zero, `SideMenuManager.menuWidth` is used.
|
||||
@IBInspectable open var menuWidth: CGFloat = 0
|
||||
|
||||
fileprivate weak var foundDelegate: UISideMenuNavigationControllerDelegate?
|
||||
fileprivate weak var activeDelegate: UISideMenuNavigationControllerDelegate? {
|
||||
guard !view.isHidden else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return sideMenuDelegate ?? foundDelegate ?? findDelegate(forViewController: presentingViewController)
|
||||
}
|
||||
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
|
||||
}
|
||||
fileprivate var usingInterfaceBuilder = false
|
||||
internal var locked = false
|
||||
internal var originalMenuBackgroundColor: UIColor?
|
||||
internal var transition: SideMenuTransition {
|
||||
return sideMenuManager.transition
|
||||
}
|
||||
|
||||
/// 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
|
||||
}
|
||||
|
||||
#if !STFU_SIDEMENU
|
||||
// This override prevents newbie developers from creating black/blank menus and opening newbie issues.
|
||||
// If you would like to remove this override, define STFU_SIDEMENU in the Active Compilation Conditions of your .plist file.
|
||||
// Sorry for the inconvenience experienced developers :(
|
||||
@available(*, unavailable, renamed: "init(rootViewController:)")
|
||||
public init() {
|
||||
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)
|
||||
}
|
||||
#endif
|
||||
|
||||
open override func awakeFromNib() {
|
||||
super.awakeFromNib()
|
||||
|
||||
// if this isn't set here, segues cause viewWillAppear and viewDidAppear to be called twice
|
||||
// likely because the transition completes and the presentingViewController is added back
|
||||
// into view for the default transition style.
|
||||
modalPresentationStyle = .overFullScreen
|
||||
}
|
||||
|
||||
/// Whether the menu appears on the right or left side of the screen. Right is the default.
|
||||
@IBInspectable open var leftSide: Bool = false {
|
||||
didSet {
|
||||
if isViewLoaded && oldValue != leftSide { // suppress warnings
|
||||
didSetSide()
|
||||
}
|
||||
}
|
||||
usingInterfaceBuilder = true
|
||||
}
|
||||
|
||||
override open func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
didSetSide()
|
||||
if !locked && usingInterfaceBuilder {
|
||||
if leftSide {
|
||||
sideMenuManager.menuLeftNavigationController = self
|
||||
} else {
|
||||
sideMenuManager.menuRightNavigationController = self
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open override func viewWillAppear(_ animated: Bool) {
|
||||
@@ -43,14 +129,9 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
|
||||
// Dismiss keyboard to prevent weird keyboard animations from occurring during transition
|
||||
presentingViewController?.view.endEditing(true)
|
||||
}
|
||||
|
||||
fileprivate func didSetSide() {
|
||||
if leftSide {
|
||||
SideMenuManager.menuLeftNavigationController = self
|
||||
} else {
|
||||
SideMenuManager.menuRightNavigationController = self
|
||||
}
|
||||
|
||||
foundDelegate = nil
|
||||
activeDelegate?.sideMenuWillAppear?(menu: self, animated: animated)
|
||||
}
|
||||
|
||||
override open func viewDidAppear(_ animated: Bool) {
|
||||
@@ -58,29 +139,39 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
|
||||
// We had presented a view before, so lets dismiss ourselves as already acted upon
|
||||
if view.isHidden {
|
||||
SideMenuTransition.hideMenuComplete()
|
||||
transition.hideMenuComplete()
|
||||
dismiss(animated: false, completion: { () -> Void in
|
||||
self.view.isHidden = false
|
||||
})
|
||||
|
||||
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
|
||||
// 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 {
|
||||
if let mainView = presentingViewController?.view {
|
||||
switch SideMenuManager.menuPresentMode {
|
||||
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 = SideMenuTransition.tapView {
|
||||
if let tapView = transition.tapView {
|
||||
mainView.superview?.insertSubview(view, aboveSubview: tapView)
|
||||
} else {
|
||||
mainView.superview?.insertSubview(view, aboveSubview: mainView)
|
||||
@@ -88,25 +179,39 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
}
|
||||
}
|
||||
|
||||
if SideMenuManager.menuDismissOnPush {
|
||||
// We're presenting a view controller from the menu, so we need to hide the menu so it isn't showing when the presented view is dismissed.
|
||||
UIView.animate(withDuration: SideMenuManager.menuAnimationDismissDuration,
|
||||
delay: 0,
|
||||
usingSpringWithDamping: SideMenuManager.menuAnimationUsingSpringWithDamping,
|
||||
initialSpringVelocity: SideMenuManager.menuAnimationInitialSpringVelocity,
|
||||
options: SideMenuManager.menuAnimationOptions,
|
||||
animations: {
|
||||
SideMenuTransition.hideMenuStart()
|
||||
}) { (finished) -> Void in
|
||||
self.view.isHidden = true
|
||||
}
|
||||
// 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
|
||||
}
|
||||
|
||||
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()
|
||||
}
|
||||
|
||||
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,
|
||||
@@ -128,16 +233,16 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
return
|
||||
}
|
||||
|
||||
NotificationCenter.default.removeObserver(SideMenuTransition.singleton, name: NSNotification.Name.UIApplicationWillChangeStatusBarFrame, object: nil)
|
||||
NotificationCenter.default.removeObserver(self.transition, name: UIApplication.willChangeStatusBarFrameNotification, object: nil)
|
||||
coordinator.animate(alongsideTransition: { (context) in
|
||||
SideMenuTransition.presentMenuStart()
|
||||
self.transition.presentMenuStart()
|
||||
}) { (context) in
|
||||
NotificationCenter.default.addObserver(SideMenuTransition.singleton, selector:#selector(SideMenuTransition.handleNotification), name: NSNotification.Name.UIApplicationWillChangeStatusBarFrame, object: nil)
|
||||
NotificationCenter.default.addObserver(self.transition, selector:#selector(SideMenuTransition.handleNotification), name: UIApplication.willChangeStatusBarFrameNotification, object: nil)
|
||||
}
|
||||
}
|
||||
|
||||
override open func pushViewController(_ viewController: UIViewController, animated: Bool) {
|
||||
guard viewControllers.count > 0 && SideMenuManager.menuPushStyle != .subMenu else {
|
||||
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.
|
||||
super.pushViewController(viewController, animated: animated)
|
||||
@@ -152,26 +257,45 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
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()
|
||||
CATransaction.setCompletionBlock( { () -> Void in
|
||||
self.dismiss(animated: true, completion: nil)
|
||||
})
|
||||
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)
|
||||
})
|
||||
|
||||
let areAnimationsEnabled = UIView.areAnimationsEnabled
|
||||
UIView.setAnimationsEnabled(true)
|
||||
UIView.animate(withDuration: SideMenuManager.menuAnimationDismissDuration, animations: { () -> Void in
|
||||
SideMenuTransition.hideMenuStart()
|
||||
})
|
||||
UIView.setAnimationsEnabled(areAnimationsEnabled)
|
||||
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) {
|
||||
if let lastViewController = navigationController.viewControllers.last, !sideMenuManager.menuAllowPushOfSameClassTwice && type(of: lastViewController) == type(of: viewController) {
|
||||
CATransaction.commit()
|
||||
return
|
||||
}
|
||||
|
||||
switch SideMenuManager.menuPushStyle {
|
||||
switch sideMenuManager.menuPushStyle {
|
||||
case .subMenu, .defaultBehavior: break // .subMenu handled earlier, .defaultBehavior falls through to end
|
||||
case .popWhenPossible:
|
||||
for subViewController in navigationController.viewControllers.reversed() {
|
||||
@@ -186,7 +310,7 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
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 {
|
||||
if sideMenuManager.menuPushStyle == .preserveAndHideBackButton {
|
||||
preservedViewController.navigationItem.hidesBackButton = true
|
||||
}
|
||||
viewControllers.append(preservedViewController)
|
||||
@@ -194,7 +318,7 @@ open class UISideMenuNavigationController: UINavigationController {
|
||||
CATransaction.commit()
|
||||
return
|
||||
}
|
||||
if SideMenuManager.menuPushStyle == .preserveAndHideBackButton {
|
||||
if sideMenuManager.menuPushStyle == .preserveAndHideBackButton {
|
||||
viewController.navigationItem.hidesBackButton = true
|
||||
}
|
||||
case .replace:
|
||||
|
||||
@@ -13,9 +13,14 @@ open class UITableViewVibrantCell: UITableViewCell {
|
||||
fileprivate var vibrancyView:UIVisualEffectView = UIVisualEffectView()
|
||||
fileprivate var vibrancySelectedBackgroundView:UIVisualEffectView = UIVisualEffectView()
|
||||
fileprivate var defaultSelectedBackgroundView:UIView?
|
||||
open var blurEffectStyle: UIBlurEffect.Style? {
|
||||
didSet {
|
||||
updateBlur()
|
||||
}
|
||||
}
|
||||
|
||||
// For registering with UITableView without subclassing otherwise dequeuing instance of the cell causes an exception
|
||||
public override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
|
||||
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
}
|
||||
|
||||
@@ -32,16 +37,16 @@ open class UITableViewVibrantCell: UITableViewCell {
|
||||
let blurSelectionEffect = UIBlurEffect(style: .light)
|
||||
vibrancySelectedBackgroundView.effect = blurSelectionEffect
|
||||
defaultSelectedBackgroundView = selectedBackgroundView
|
||||
|
||||
updateBlur()
|
||||
}
|
||||
|
||||
override open func layoutSubviews() {
|
||||
super.layoutSubviews()
|
||||
|
||||
internal func updateBlur() {
|
||||
// shouldn't be needed but backgroundColor is set to white on iPad:
|
||||
backgroundColor = UIColor.clear
|
||||
|
||||
if !UIAccessibilityIsReduceTransparencyEnabled() && SideMenuManager.menuBlurEffectStyle != nil {
|
||||
let blurEffect = UIBlurEffect(style: SideMenuManager.menuBlurEffectStyle!)
|
||||
if let blurEffectStyle = blurEffectStyle, !UIAccessibility.isReduceTransparencyEnabled {
|
||||
let blurEffect = UIBlurEffect(style: blurEffectStyle)
|
||||
vibrancyView.effect = UIVibrancyEffect(blurEffect: blurEffect)
|
||||
|
||||
if selectedBackgroundView != nil && selectedBackgroundView != vibrancySelectedBackgroundView {
|
||||
|
||||
Generated
+12
-3
@@ -328,7 +328,12 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0730;
|
||||
LastUpgradeCheck = 0900;
|
||||
LastUpgradeCheck = 0930;
|
||||
TargetAttributes = {
|
||||
88B64A039CB85A823B85B2EF1C336387 = {
|
||||
LastSwiftMigration = 1000;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
@@ -409,12 +414,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;
|
||||
@@ -476,7 +483,7 @@
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 4.0;
|
||||
SWIFT_VERSION = 4.2;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
@@ -496,12 +503,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;
|
||||
@@ -705,7 +714,7 @@
|
||||
PRODUCT_NAME = SideMenu;
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 4.0;
|
||||
SWIFT_VERSION = 4.2;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
# ▤ SideMenu
|
||||
[](http://cocoapods.org/pods/SideMenu)
|
||||
[](https://github.com/Carthage/Carthage)
|
||||
[](http://cocoapods.org/pods/SideMenu)
|
||||
[](http://cocoapods.org/pods/SideMenu)
|
||||
[](http://cocoapods.org/pods/SideMenu)
|
||||
[](https://github.com/Carthage/Carthage)
|
||||
[](http://cocoapods.org/pods/SideMenu)
|
||||
[](http://cocoapods.org/pods/SideMenu)
|
||||
[](http://cocoapods.org/pods/SideMenu)
|
||||
[](http://cocoapods.org/pods/SideMenu)
|
||||
[](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¤cy_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¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted). (only **4** people have donated since inception 😕 but **thank you** to those who have!)
|
||||
|
||||
* **[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,12 @@ Check out the example project to see it in action!
|
||||
### Preview Samples
|
||||
| Slide Out | Slide In | Dissolve | Slide In + Out |
|
||||
| --- | --- | --- | --- |
|
||||
|  |  |  |  |
|
||||
|  |  |  |  |
|
||||
|
||||
## Requirements
|
||||
- [x] iOS 8 or higher
|
||||
- [x] Xcode 10.
|
||||
- [x] Swift 4.2.
|
||||
- [x] iOS 10 or higher.
|
||||
|
||||
## Installation
|
||||
### CocoaPods
|
||||
@@ -51,8 +74,11 @@ use_frameworks!
|
||||
|
||||
pod 'SideMenu'
|
||||
|
||||
# For Swift 2.3 (no longer maintained), use:
|
||||
# pod 'SideMenu', '~> 1.2.1'
|
||||
# For Swift 4 (no longer maintained), use:
|
||||
# pod 'SideMenu', '~> 4.0.0'
|
||||
|
||||
# For Swift 3 (no longer maintained), use:
|
||||
# pod 'SideMenu', '~> 2.3.4'
|
||||
```
|
||||
|
||||
Then, run the following command:
|
||||
@@ -81,13 +107,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.
|
||||

|
||||

|
||||
|
||||
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.
|
||||

|
||||

|
||||
|
||||
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.
|
||||

|
||||

|
||||
|
||||
That's it. *Note: you can only enable gestures in code.*
|
||||
### Code Implementation
|
||||
@@ -100,36 +126,33 @@ In your view controller's `viewDidLoad` event, do something like this (**IMPORTA
|
||||
``` swift
|
||||
// Define the menus
|
||||
let menuLeftNavigationController = UISideMenuNavigationController(rootViewController: YourViewController)
|
||||
menuLeftNavigationController.leftSide = true
|
||||
// UISideMenuNavigationController is a subclass of UINavigationController, so do any additional configuration
|
||||
// of it here like setting its viewControllers. If you're using storyboards, you'll want to do something like:
|
||||
// let menuLeftNavigationController = storyboard!.instantiateViewController(withIdentifier: "LeftMenuNavigationController") as! UISideMenuNavigationController
|
||||
SideMenuManager.menuLeftNavigationController = menuLeftNavigationController
|
||||
SideMenuManager.default.menuLeftNavigationController = menuLeftNavigationController
|
||||
|
||||
let menuRightNavigationController = UISideMenuNavigationController(rootViewController: YourViewController)
|
||||
// UISideMenuNavigationController is a subclass of UINavigationController, so do any additional configuration
|
||||
// of it here like setting its viewControllers. If you're using storyboards, you'll want to do something like:
|
||||
// let menuRightNavigationController = storyboard!.instantiateViewController(withIdentifier: "RightMenuNavigationController") as! UISideMenuNavigationController
|
||||
SideMenuManager.menuRightNavigationController = menuRightNavigationController
|
||||
SideMenuManager.default.menuRightNavigationController = menuRightNavigationController
|
||||
|
||||
// Enable gestures. The left and/or right menus must be set up above for these to work.
|
||||
// Note that these continue to work on the Navigation Controller independent of the view controller it displays!
|
||||
SideMenuManager.menuAddPanGestureToPresent(toView: self.navigationController!.navigationBar)
|
||||
SideMenuManager.menuAddScreenEdgePanGesturesToPresent(toView: self.navigationController!.view)
|
||||
SideMenuManager.default.menuAddPanGestureToPresent(toView: self.navigationController!.navigationBar)
|
||||
SideMenuManager.default.menuAddScreenEdgePanGesturesToPresent(toView: self.navigationController!.view)
|
||||
```
|
||||
Then from a button, do something like this:
|
||||
``` swift
|
||||
present(SideMenuManager.menuLeftNavigationController!, animated: true, completion: nil)
|
||||
present(SideMenuManager.default.menuLeftNavigationController!, animated: true, completion: nil)
|
||||
|
||||
// Similarly, to dismiss a menu programmatically, you would do this:
|
||||
dismiss(animated: true, completion: nil)
|
||||
|
||||
// For Swift 2.3 (no longer maintained), use:
|
||||
// presentViewController(SideMenuManager.menuLeftNavigationController!, animated: true, completion: nil)
|
||||
```
|
||||
That's it.
|
||||
### Customization
|
||||
Just type `SideMenuManager.menu...` and code completion will show you everything you can customize (defaults are shown below for reference):
|
||||
#### SideMenuManager
|
||||
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.
|
||||
@@ -139,10 +162,10 @@ 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 static var menuPushStyle: MenuPushStyle = .defaultBehavior
|
||||
open var menuPushStyle: MenuPushStyle = .defaultBehavior
|
||||
|
||||
/**
|
||||
The presentation mode of the menu.
|
||||
@@ -153,64 +176,74 @@ There are four modes in MenuPresentMode:
|
||||
- viewSlideInOut: The existing view slides out while the menu slides in.
|
||||
- menuDissolveIn: The menu dissolves in over the existing view controller.
|
||||
*/
|
||||
open static var menuPresentMode: MenuPresentMode = .viewSlideOut
|
||||
open var menuPresentMode: MenuPresentMode = .viewSlideOut
|
||||
|
||||
/// Prevents the same view controller (or a view controller of the same class) from being pushed more than once. Defaults to true.
|
||||
open static var menuAllowPushOfSameClassTwice = true
|
||||
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.
|
||||
open static var menuWidth: CGFloat = max(round(min((appScreenRect.width), (appScreenRect.height)) * 0.75), 240)
|
||||
/**
|
||||
Width of the menu when presented on screen, showing the existing view controller in the remaining space. Default is 75% of the screen width.
|
||||
|
||||
Note that each menu's width can be overridden using the `menuWidth` property on any `UISideMenuNavigationController` instance.
|
||||
*/
|
||||
open var menuWidth: CGFloat = max(round(min((appScreenRect.width), (appScreenRect.height)) * 0.75), 240)
|
||||
|
||||
/// Duration of the animation when the menu is presented without gestures. Default is 0.35 seconds.
|
||||
open static var menuAnimationPresentDuration = 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 static var menuAnimationDismissDuration = 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
|
||||
|
||||
/// Amount to fade the existing view controller when the menu is presented. Default is 0 for no fade. Set to 1 to fade completely.
|
||||
open static var menuAnimationFadeStrength: CGFloat = 0
|
||||
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 static 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 static 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 static 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 static 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 static var menuShadowRadius: CGFloat = 5
|
||||
open var menuShadowRadius: CGFloat = 5
|
||||
|
||||
/// The left menu swipe to dismiss gesture.
|
||||
open static weak var menuLeftSwipeToDismissGesture: UIPanGestureRecognizer?
|
||||
open weak var menuLeftSwipeToDismissGesture: UIPanGestureRecognizer?
|
||||
|
||||
/// The right menu swipe to dismiss gesture.
|
||||
open static weak var menuRightSwipeToDismissGesture: UIPanGestureRecognizer?
|
||||
open weak var menuRightSwipeToDismissGesture: UIPanGestureRecognizer?
|
||||
|
||||
/// Enable or disable gestures that would swipe to dismiss the menu. Default is true.
|
||||
open static var menuEnableSwipeGestures: Bool = true
|
||||
open var menuEnableSwipeGestures: Bool = true
|
||||
|
||||
/// 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 static 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 static var menuParallaxStrength: Int = 0
|
||||
open var menuParallaxStrength: Int = 0
|
||||
|
||||
/// Draws the `menuAnimationBackgroundColor` behind the status bar. Default is true.
|
||||
open static var menuFadeStatusBar = true
|
||||
open var menuFadeStatusBar = true
|
||||
|
||||
/// The animation options when a menu is displayed. Ignored when displayed with a gesture.
|
||||
open static var menuAnimationOptions: UIViewAnimationOptions = .curveEaseInOut
|
||||
open var menuAnimationOptions: UIViewAnimationOptions = .curveEaseInOut
|
||||
|
||||
/// Animation curve of the remaining animation when the menu is partially dismissed with gestures. Default is .easeIn.
|
||||
open var menuAnimationCompletionCurve: UIViewAnimationCurve = .easeIn
|
||||
|
||||
/// The animation spring damping when a menu is displayed. Ignored when displayed with a gesture.
|
||||
open static 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 static var menuAnimationInitialSpringVelocity: CGFloat = 1
|
||||
open var menuAnimationInitialSpringVelocity: CGFloat = 1
|
||||
|
||||
/**
|
||||
Automatically dismisses the menu when another view is pushed from it.
|
||||
@@ -218,43 +251,115 @@ Automatically dismisses the menu when another view is pushed from it.
|
||||
Note: to prevent the menu from dismissing when presenting, set modalPresentationStyle = .overFullScreen
|
||||
of the view controller being presented in storyboard or during its initalization.
|
||||
*/
|
||||
open static var menuDismissOnPush = true
|
||||
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
|
||||
|
||||
/**
|
||||
The blur effect style of the menu if the menu's root view controller is a UITableViewController or UICollectionViewController.
|
||||
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 static var menuBlurEffectStyle: UIBlurEffectStyle?
|
||||
- Note: If you want cells in a UITableViewController menu to show vibrancy, make them a subclass of UITableViewVibrantCell and set the `blurEffectStyle` of each cell to SideMenuManager.default.menuBlurEffectStyle.
|
||||
*/
|
||||
open var menuBlurEffectStyle: UIBlurEffectStyle?
|
||||
|
||||
/// The left menu.
|
||||
open static var menuLeftNavigationController: UISideMenuNavigationController?
|
||||
open var menuLeftNavigationController: UISideMenuNavigationController?
|
||||
|
||||
/// The right menu.
|
||||
open static var menuRightNavigationController: UISideMenuNavigationController?
|
||||
open var menuRightNavigationController: UISideMenuNavigationController?
|
||||
|
||||
/**
|
||||
Adds screen edge gestures to a view to present a menu.
|
||||
Adds screen edge gestures to a view to present a menu.
|
||||
|
||||
- Parameter toView: The view to add gestures to.
|
||||
- Parameter forMenu: The menu (left or right) you want to add a gesture for. If unspecified, gestur=es will be added for both sides.
|
||||
- Parameter toView: The view to add gestures to.
|
||||
- Parameter forMenu: The menu (left or right) you want to add a gesture for. If unspecified, gestures will be added for both sides.
|
||||
|
||||
- Returns: The array of screen edge gestures added to `toView`.
|
||||
*/
|
||||
@discardableResult open class func menuAddScreenEdgePanGesturesToPresent(toView: UIView, forMenu:UIRectEdge? = nil) -> [UIScreenEdgePanGestureRecognizer]
|
||||
- Returns: The array of screen edge gestures added to `toView`.
|
||||
*/
|
||||
@discardableResult open func menuAddScreenEdgePanGesturesToPresent(toView: UIView, forMenu:UIRectEdge? = nil) -> [UIScreenEdgePanGestureRecognizer]
|
||||
|
||||
/**
|
||||
Adds a pan edge gesture to a view to present menus.
|
||||
Adds a pan edge gesture to a view to present menus.
|
||||
|
||||
- Parameter toView: The view to add a pan gesture to.
|
||||
- Parameter toView: The view to add a pan gesture to.
|
||||
|
||||
- Returns: The pan gesture added to `toView`.
|
||||
*/
|
||||
@discardableResult open class func menuAddPanGestureToPresent(toView: UIView) -> UIPanGestureRecognizer
|
||||
- Returns: The pan gesture added to `toView`.
|
||||
*/
|
||||
@discardableResult open func menuAddPanGestureToPresent(toView: UIView) -> UIPanGestureRecognizer
|
||||
```
|
||||
#### UISideMenuNavigationController
|
||||
`UISideMenuNavigationController` supports the following customizations and properties:
|
||||
``` swift
|
||||
/// 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
|
||||
|
||||
/// 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
|
||||
|
||||
/// 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
|
||||
|
||||
/// Indicates if the menu is anywhere in the view hierarchy, even if covered by another view controller.
|
||||
open var isHidden: Bool
|
||||
```
|
||||
#### UISideMenuNavigationControllerDelegate
|
||||
To receive notifications when a menu is displayed from a view controller, have it adhere to the `UISideMenuNavigationControllerDelegate` protocol:
|
||||
``` swift
|
||||
extension MyViewController: UISideMenuNavigationControllerDelegate {
|
||||
|
||||
func sideMenuWillAppear(menu: UISideMenuNavigationController, animated: Bool) {
|
||||
print("SideMenu Appearing! (animated: \(animated))")
|
||||
}
|
||||
|
||||
func sideMenuDidAppear(menu: UISideMenuNavigationController, animated: Bool) {
|
||||
print("SideMenu Appeared! (animated: \(animated))")
|
||||
}
|
||||
|
||||
func sideMenuWillDisappear(menu: UISideMenuNavigationController, animated: Bool) {
|
||||
print("SideMenu Disappearing! (animated: \(animated))")
|
||||
}
|
||||
|
||||
func sideMenuDidDisappear(menu: UISideMenuNavigationController, animated: Bool) {
|
||||
print("SideMenu Disappeared! (animated: \(animated))")
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
*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.
|
||||
``` swift
|
||||
let customSideMenuManager = SideMenuManager()
|
||||
```
|
||||
2. Setup and display menus with your custom instance the same as you would with the `SideMenuManager.default` instance.
|
||||
3. If using Storyboards, subclass your instance of `UISideMenuNavigationController` and set its `sideMenuManager` property to your custom instance. This must be done before `viewDidLoad` is called:
|
||||
``` swift
|
||||
class MySideMenuNavigationController: UISideMenuNavigationController {
|
||||
|
||||
let customSideMenuManager = SideMenuManager()
|
||||
|
||||
override func awakeFromNib() {
|
||||
super.awakeFromNib()
|
||||
|
||||
sideMenuManager = customSideMenuManager
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
Alternatively, you can set `sideMenuManager` from the view controller that segues to your UISideMenuNavigationController:
|
||||
``` swift
|
||||
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
|
||||
if let sideMenuNavigationController = segue.destination as? UISideMenuNavigationController {
|
||||
sideMenuNavigationController.sideMenuManager = customSideMenuManager
|
||||
}
|
||||
}
|
||||
```
|
||||
*Important: displaying SideMenu instances directly over each other is not supported. Use `menuPushStyle = .subMenu` instead.*
|
||||
## Known Issues
|
||||
Don't try to change the status bar appearance when presenting a menu. When used with quick gestures/animations, it causes the presentation animation to not complete properly and locks the UI. This was fixed in iOS 9.3. See [radar 21961293](http://www.openradar.me/21961293) for more information.
|
||||
* Issue [#258](https://github.com/jonkykong/SideMenu/issues/258).
|
||||
* Don't try to change the status bar appearance when presenting a menu. When used with quick gestures/animations, it causes the presentation animation to not complete properly and locks the UI. This was fixed in iOS 9.3. See [radar 21961293](http://www.openradar.me/21961293) for more information.
|
||||
|
||||
## Thank You
|
||||
A special thank you to everyone that has [contributed](https://github.com/jonkykong/SideMenu/graphs/contributors) to this library to make it better. Your support is appreciated!
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "SideMenu"
|
||||
s.version = "3.0.1"
|
||||
s.version = "5.0.1"
|
||||
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,15 +7,12 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
108F6C478E56A4CA081F8E09 /* Pods_Example_ExampleTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52C8DD7BE43A8987854CA726 /* Pods_Example_ExampleTests.framework */; };
|
||||
456193561EADC00AC505B531 /* Pods_ExampleTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D1435FAD2F735E43F383BE96 /* Pods_ExampleTests.framework */; };
|
||||
65FF1B3E1DE321D8007B0845 /* SideMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = 65FF1B3D1DE321D8007B0845 /* SideMenu.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
7B48A0D61DCB2487002990A1 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B48A0D51DCB2487002990A1 /* AppDelegate.swift */; };
|
||||
7B48A0DD1DCB2487002990A1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7B48A0DC1DCB2487002990A1 /* Assets.xcassets */; };
|
||||
7B48A0EB1DCB2487002990A1 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B48A0EA1DCB2487002990A1 /* Tests.swift */; };
|
||||
7B48A0F61DCB2518002990A1 /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B48A0F31DCB2518002990A1 /* MainViewController.swift */; };
|
||||
7B48A0F71DCB2518002990A1 /* PresentedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B48A0F41DCB2518002990A1 /* PresentedViewController.swift */; };
|
||||
7B48A0F81DCB2518002990A1 /* SideMenuTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B48A0F51DCB2518002990A1 /* SideMenuTableView.swift */; };
|
||||
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 */; };
|
||||
8461A2D31E145A08001DA4F8 /* SideMenuManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8461A2CF1E145A08001DA4F8 /* SideMenuManager.swift */; };
|
||||
@@ -28,16 +25,6 @@
|
||||
ACD6DAED90DE36FEA68CDF38 /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 47896ABC5C8830D88945A8D3 /* Pods_Example.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
7B48A0E71DCB2487002990A1 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 7B9DC8FB1DC6E8C1000D4007 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 7B48A0D21DCB2487002990A1;
|
||||
remoteInfo = Example;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
1F17B9D56ADA958C611FAA83 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
281FB58A39C022692CEEBF0D /* Pods-Example-ExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-ExampleTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
@@ -48,12 +35,11 @@
|
||||
7B48A0D51DCB2487002990A1 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
7B48A0DC1DCB2487002990A1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
7B48A0E11DCB2487002990A1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
7B48A0E61DCB2487002990A1 /* ExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
7B48A0EA1DCB2487002990A1 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = "<group>"; };
|
||||
7B48A0EC1DCB2487002990A1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
7B48A0F31DCB2518002990A1 /* MainViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = "<group>"; };
|
||||
7B48A0F41DCB2518002990A1 /* PresentedViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PresentedViewController.swift; sourceTree = "<group>"; };
|
||||
7B48A0F51DCB2518002990A1 /* SideMenuTableView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SideMenuTableView.swift; sourceTree = "<group>"; };
|
||||
7B48A0F51DCB2518002990A1 /* SideMenuTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SideMenuTableViewController.swift; sourceTree = "<group>"; };
|
||||
7B552D5C1DCC65830010301C /* Launch Screen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; };
|
||||
7B5FA9B51DCB269700278DF6 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
|
||||
7B9DC9041DC6E8C1000D4007 /* SideMenu.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SideMenu.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
@@ -80,15 +66,6 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
7B48A0E31DCB2487002990A1 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
456193561EADC00AC505B531 /* Pods_ExampleTests.framework in Frameworks */,
|
||||
108F6C478E56A4CA081F8E09 /* Pods_Example_ExampleTests.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
7B9DC9001DC6E8C1000D4007 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -124,10 +101,10 @@
|
||||
65FF1B391DE31DA3007B0845 /* SupportingFiles */,
|
||||
7B48A0D51DCB2487002990A1 /* AppDelegate.swift */,
|
||||
7B48A0F31DCB2518002990A1 /* MainViewController.swift */,
|
||||
7B48A0F51DCB2518002990A1 /* SideMenuTableViewController.swift */,
|
||||
7B48A0F41DCB2518002990A1 /* PresentedViewController.swift */,
|
||||
7B552D5C1DCC65830010301C /* Launch Screen.storyboard */,
|
||||
7B5FA9B51DCB269700278DF6 /* Main.storyboard */,
|
||||
7B48A0F51DCB2518002990A1 /* SideMenuTableView.swift */,
|
||||
7B48A0DC1DCB2487002990A1 /* Assets.xcassets */,
|
||||
7B48A0E11DCB2487002990A1 /* Info.plist */,
|
||||
);
|
||||
@@ -161,7 +138,6 @@
|
||||
children = (
|
||||
7B9DC9041DC6E8C1000D4007 /* SideMenu.framework */,
|
||||
7B48A0D31DCB2487002990A1 /* Example.app */,
|
||||
7B48A0E61DCB2487002990A1 /* ExampleTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -233,27 +209,6 @@
|
||||
productReference = 7B48A0D31DCB2487002990A1 /* Example.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
7B48A0E51DCB2487002990A1 /* ExampleTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 7B48A0F21DCB2487002990A1 /* Build configuration list for PBXNativeTarget "ExampleTests" */;
|
||||
buildPhases = (
|
||||
189AEFF809982E08C107BDD8 /* [CP] Check Pods Manifest.lock */,
|
||||
7B48A0E21DCB2487002990A1 /* Sources */,
|
||||
7B48A0E31DCB2487002990A1 /* Frameworks */,
|
||||
7B48A0E41DCB2487002990A1 /* Resources */,
|
||||
A5F2AF9B69C815BBA71DAD09 /* [CP] Embed Pods Frameworks */,
|
||||
3625CA9A4E129791488E06FE /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
7B48A0E81DCB2487002990A1 /* PBXTargetDependency */,
|
||||
);
|
||||
name = ExampleTests;
|
||||
productName = ExampleTests;
|
||||
productReference = 7B48A0E61DCB2487002990A1 /* ExampleTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
7B9DC9031DC6E8C1000D4007 /* SideMenu */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 7B9DC90C1DC6E8C1000D4007 /* Build configuration list for PBXNativeTarget "SideMenu" */;
|
||||
@@ -279,20 +234,15 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0800;
|
||||
LastUpgradeCheck = 0900;
|
||||
LastUpgradeCheck = 0930;
|
||||
ORGANIZATIONNAME = jonkykong;
|
||||
TargetAttributes = {
|
||||
7B48A0D21DCB2487002990A1 = {
|
||||
CreatedOnToolsVersion = 8.0;
|
||||
DevelopmentTeam = QTJ767UH3L;
|
||||
LastSwiftMigration = 0900;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
7B48A0E51DCB2487002990A1 = {
|
||||
CreatedOnToolsVersion = 8.0;
|
||||
LastSwiftMigration = 0900;
|
||||
ProvisioningStyle = Automatic;
|
||||
TestTargetID = 7B48A0D21DCB2487002990A1;
|
||||
};
|
||||
7B9DC9031DC6E8C1000D4007 = {
|
||||
CreatedOnToolsVersion = 8.0;
|
||||
LastSwiftMigration = 0900;
|
||||
@@ -315,7 +265,6 @@
|
||||
targets = (
|
||||
7B9DC9031DC6E8C1000D4007 /* SideMenu */,
|
||||
7B48A0D21DCB2487002990A1 /* Example */,
|
||||
7B48A0E51DCB2487002990A1 /* ExampleTests */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
@@ -331,13 +280,6 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
7B48A0E41DCB2487002990A1 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
7B9DC9021DC6E8C1000D4007 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -351,36 +293,6 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
189AEFF809982E08C107BDD8 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
);
|
||||
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";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
3625CA9A4E129791488E06FE /* [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-ExampleTests/Pods-Example-ExampleTests-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
558DEC0A930F44C17D50F99B /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -411,21 +323,6 @@
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
A5F2AF9B69C815BBA71DAD09 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
B96CD08B77E6CAC7B3180AE2 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -448,21 +345,13 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
7B48A0F81DCB2518002990A1 /* SideMenuTableView.swift in Sources */,
|
||||
7B48A0F81DCB2518002990A1 /* SideMenuTableViewController.swift in Sources */,
|
||||
7B48A0F61DCB2518002990A1 /* MainViewController.swift in Sources */,
|
||||
7B48A0F71DCB2518002990A1 /* PresentedViewController.swift in Sources */,
|
||||
7B48A0D61DCB2487002990A1 /* AppDelegate.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
7B48A0E21DCB2487002990A1 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
7B48A0EB1DCB2487002990A1 /* Tests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
7B9DC8FF1DC6E8C1000D4007 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -476,14 +365,6 @@
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
7B48A0E81DCB2487002990A1 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 7B48A0D21DCB2487002990A1 /* Example */;
|
||||
targetProxy = 7B48A0E71DCB2487002990A1 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
7B48A0ED1DCB2487002990A1 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
@@ -495,7 +376,7 @@
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.jonkykong.Example;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 4.0;
|
||||
SWIFT_VERSION = 4.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -509,37 +390,7 @@
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.jonkykong.Example;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 4.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
7B48A0EF1DCB2487002990A1 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 281FB58A39C022692CEEBF0D /* Pods-Example-ExampleTests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
INFOPLIST_FILE = ExampleTests/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.jonkykong.ExampleTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 4.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
7B48A0F01DCB2487002990A1 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = CAE41BBB5F14E59C1FA0A821 /* Pods-Example-ExampleTests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
INFOPLIST_FILE = ExampleTests/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.jonkykong.ExampleTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 4.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example";
|
||||
SWIFT_VERSION = 4.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -556,6 +407,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 +415,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,12 +444,13 @@
|
||||
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 = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 4.2;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
@@ -616,6 +470,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 +478,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,10 +501,11 @@
|
||||
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 = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 4.2;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
@@ -674,7 +531,7 @@
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 4.0;
|
||||
SWIFT_VERSION = 4.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -695,7 +552,7 @@
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.jonkykong.SideMenu;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 4.0;
|
||||
SWIFT_VERSION = 4.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -711,15 +568,6 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
7B48A0F21DCB2487002990A1 /* Build configuration list for PBXNativeTarget "ExampleTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
7B48A0EF1DCB2487002990A1 /* Debug */,
|
||||
7B48A0F01DCB2487002990A1 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
7B9DC8FE1DC6E8C1000D4007 /* Build configuration list for PBXProject "SideMenu" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
|
||||
@@ -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>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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/>
|
||||
</plist>
|
||||
Reference in New Issue
Block a user