Compare commits

...

226 Commits

Author SHA1 Message Date
jonkykong 2e684440fc Update README for Cocoapods. 2017-10-31 00:28:19 -07:00
jonkykong 6064d6d5fc Updated podspec. 2017-10-31 00:27:58 -07:00
Lawrence Gimenez d13ed0ea9b Fixed SideMenu.UISideMenuNavigationController crash on init(nibName:bundle:) 2017-10-31 15:06:59 +08:00
jonkykong ef607b3ab2 Update README for Github. 2017-10-28 12:05:27 -07:00
jonkykong 069b974145 Merge tag '3.1.3'
* tag '3.1.3':
  Update README for cocoapods.
  Updated podspec.
  Updated README.
2017-10-28 12:04:53 -07:00
jonkykong 3e452b2a69 Update README for cocoapods. 2017-10-28 11:58:48 -07:00
jonkykong 021fe8cd6a Merge branch 'master' into 3.1.3
* master:
  Exposed delegate to @objc.
  Adding omitted initializer.
  README corrections.
2017-10-28 11:58:01 -07:00
jonkykong fd6ecbbece Updated podspec. 2017-10-28 11:55:43 -07:00
jonkykong 313cda5d69 Updated README. 2017-10-28 11:55:24 -07:00
jonkykong e35a46b075 Exposed delegate to @objc. 2017-10-28 11:52:58 -07:00
jonkykong 3702ecb770 Adding omitted initializer. 2017-10-28 11:52:23 -07:00
jonkykong 893818b582 README corrections. 2017-10-26 18:48:29 -07:00
jonkykong f21ed8965d Revert README for Github. 2017-10-26 18:40:22 -07:00
jonkykong db1cf2a6b6 Merge tag '3.1.2'
* tag '3.1.2':
  Updated podspec.
  Updated README.
  Allow for specifying the sideMenuDelegate, otherwise it discovers it automatically.
  Last commit was incorrect -- but this commit fixes it and includes a work-around for more experience devs who may still want to use default initializer as well as silence some newbie warnings.
  Override of navigation controller default init to prevent new developers from seeing black menus.
  It should be possible now to have the menu slide out even if pushing the new view is not animated itself (animating both can look a bit weird when relying on 'animated' only)
2017-10-26 18:39:49 -07:00
jonkykong a66367d84a Updated podspec. 2017-10-26 18:10:58 -07:00
jonkykong 5f8bdab1dc Updated README. 2017-10-26 18:10:23 -07:00
jonkykong 86f592a20d Support for forcing animated menu dismissal even when pushed view controllers are not animated. 2017-10-26 18:08:43 -07:00
jonkykong dd0a14fa61 Allow for specifying the sideMenuDelegate, otherwise it discovers it automatically. 2017-10-26 17:07:46 -07:00
jonkykong 2ba0ef7453 Last commit was incorrect -- but this commit fixes it and includes a work-around for more experience devs who may still want to use default initializer as well as silence some newbie warnings. 2017-10-24 12:15:41 -07:00
jonkykong 6f57e37129 Override of navigation controller default init to prevent new developers from seeing black menus. 2017-10-24 12:13:06 -07:00
Andreas Hilbert 2af0d86c97 It should be possible now to have the menu slide out even if pushing the new view is not animated itself (animating both can look a bit weird when relying on 'animated' only) 2017-10-19 12:11:20 +02:00
Jon Kent 3dc08de6ec Update README.md 2017-10-17 20:03:10 -07:00
Jon Kent 646f2a8094 Update README.md 2017-10-16 23:18:59 -07:00
Jon Kent ef867ff2b3 Update README.md 2017-10-16 23:18:26 -07:00
jonkykong 49dd185fa7 Updated README for Github. 2017-10-11 14:45:34 -07:00
jonkykong 6a87536f76 Merge tag '3.1.1'
* tag '3.1.1':
  Updated podspec.
  Update README for Cocoapods.
  README correction.
  Better logic for managing UISideMenuNavigationController properties across interface builder and programmatic instantiations.
2017-10-11 14:45:10 -07:00
jonkykong a2f299bb5f Updated podspec. 2017-10-11 14:43:08 -07:00
jonkykong 031f97d770 Update README for Cocoapods. 2017-10-11 14:40:45 -07:00
jonkykong 977f9a5b70 README correction. 2017-10-11 14:39:34 -07:00
jonkykong 3a14516905 Better logic for managing UISideMenuNavigationController properties across interface builder and programmatic instantiations. 2017-10-11 14:39:22 -07:00
jonkykong ddefba9c87 Revert README for Github. 2017-10-10 18:37:00 -07:00
jonkykong d3f59a45a7 Merge tag '3.1'
* tag '3.1':
  Updated README for Cocoapods.
  Updated podspec.
  Update README.md
  Updated README.
  Fix for non-animated dismissal of menu causing a black screen.
  Renamed class and refactored how blurring works in UITableViewVibrantCell.
  Major project update to support multiple SideMenuManager instances beyond the primary instance, if necessary.
  Added isHidden property.
  Support for delegate methods on SideMenu appearing/disappearing.
  Refactor.
  Refactoring.
  Fix for menuDismissOnPush as it was incorrectly applied.
  Fix for regression on enums to objective-C.
2017-10-10 18:36:29 -07:00
jonkykong 1d2f233e7f Updated README for Cocoapods. 2017-10-10 18:33:31 -07:00
jonkykong 2a650bec7f no message 2017-10-10 18:31:05 -07:00
jonkykong a8cb38c798 Updated podspec. 2017-10-10 18:27:15 -07:00
Jon Kent b7386851df Update README.md 2017-10-10 18:26:53 -07:00
jonkykong 6e1cb822bf Updated README. 2017-10-10 17:37:13 -07:00
jonkykong 10197c53cf Fix for non-animated dismissal of menu causing a black screen. 2017-10-10 17:37:00 -07:00
jonkykong 90e252dc78 Renamed class and refactored how blurring works in UITableViewVibrantCell. 2017-10-10 17:36:29 -07:00
jonkykong 553cdeae98 Major project update to support multiple SideMenuManager instances beyond the primary instance, if necessary. 2017-10-10 17:24:07 -07:00
jonkykong 26b26c4862 Added isHidden property. 2017-10-06 16:56:40 -07:00
jonkykong 05f8012c66 Support for delegate methods on SideMenu appearing/disappearing. 2017-10-06 16:56:25 -07:00
jonkykong 45586dd398 Refactor. 2017-10-06 16:55:05 -07:00
jonkykong 92375186c8 Refactoring. 2017-10-06 16:52:57 -07:00
jonkykong c63f86feae Fix for menuDismissOnPush as it was incorrectly applied. 2017-10-06 16:51:39 -07:00
jonkykong 3e01179dec Fix for regression on enums to objective-C. 2017-10-06 16:43:01 -07:00
jonkykong 8a3ebd672e Revert README for Github. 2017-09-26 23:50:54 -07:00
jonkykong c6a04437b6 Merge tag '3.0.2'
* tag '3.0.2':
  Updated podspec and README for cocoapods.
  Corrected logic for default menu width.
2017-09-26 23:50:08 -07:00
jonkykong bf241ec554 Updated podspec and README for cocoapods. 2017-09-26 23:46:56 -07:00
jonkykong d867a67899 Corrected logic for default menu width. 2017-09-26 23:42:32 -07:00
Jon Kent 80213f5e88 Merge pull request #261 from jonkykong/add-code-of-conduct-1-1
Create CODE_OF_CONDUCT.md
2017-09-21 13:41:10 -07:00
Jon Kent 66cc6cad35 Create CODE_OF_CONDUCT.md 2017-09-21 13:40:46 -07:00
Jon Kent db97060777 Update README.md 2017-09-21 13:31:08 -07:00
Jon Kent 4d32054356 Update README.md 2017-09-21 04:49:43 -07:00
jonkykong 432dfe988f Updated README for Github. 2017-09-21 04:47:27 -07:00
jonkykong 1e8f091bb0 Merge tag '3.0.1'
* tag '3.0.1':
  Updated podspec.
  Fixed hack to more specific logic.
2017-09-21 04:41:45 -07:00
jonkykong f2df2e28d8 Updated podspec. 2017-09-21 04:41:11 -07:00
jonkykong b6a2466dec Fixed hack to more specific logic. 2017-09-21 04:40:42 -07:00
jonkykong 8bbe75d5c7 Merge tag '3.0.0'
* tag '3.0.0':
  Updated podspec.
  Additional Swift4 support updates.
  Fix for Swift 4 and version 2.3.4
2017-09-21 04:25:21 -07:00
jonkykong ad462962fd Updated podspec. 2017-09-21 04:23:19 -07:00
jonkykong 6ed444f433 Merge branch 'pr/253' into 3.0.0
* pr/253:
  Additional Swift4 support updates.
  Fix for Swift 4 and version 2.3.4
2017-09-21 04:12:50 -07:00
jonkykong a65e26cb47 Additional Swift4 support updates. 2017-09-21 02:59:40 -07:00
jonkykong 94610771b4 Merge tag '2.3.4'
* tag '2.3.4':
  Updated README and podspec.
  Added comment.
  Changed menuAnimationCompleteGestureDuration default.
  Changing individual menu width properties in favor of a property on UISideMenuNavigationController.
  Refactor.
  Formatting.
  Support for UISplitViewControllers when pushing view controllers.
  These methods will never be called as they are handled by the topViewController.
  Neglected to use menuDismissOnPush switch in code.
  Fixes to maintain iOS 11 animation smoothness.
  Refactor.
  Changed MainViewController's scrollview to align to the topLayoutGuide.
  Add missing designated initialiser to UITableViewVibrantCell
  Set right menu width equal half of left menu width in example
  Add supporting of different left and right menu width
2017-09-21 02:04:58 -07:00
jonkykong 5599796e9d Updated README and podspec. 2017-09-21 02:04:06 -07:00
jonkykong 33449c84a0 Merge branch 'pr/248' into 2.3.4
* pr/248:
  Added comment.
  Add missing designated initialiser to UITableViewVibrantCell
2017-09-21 01:53:02 -07:00
jonkykong 458b246013 Added comment. 2017-09-21 01:52:44 -07:00
jonkykong a58a170979 Changed menuAnimationCompleteGestureDuration default. 2017-09-21 01:35:46 -07:00
jonkykong e4c43569de Merge branch 'pr/228' into 2.3.4
* pr/228:
  Changing individual menu width properties in favor of a property on UISideMenuNavigationController.
  Set right menu width equal half of left menu width in example
  Add supporting of different left and right menu width

# Conflicts:
#	Pod/Classes/SideMenuTransition.swift
2017-09-21 01:34:34 -07:00
jonkykong 966e1c9976 Changing individual menu width properties in favor of a property on UISideMenuNavigationController. 2017-09-21 01:30:58 -07:00
jonkykong 1241215e53 Refactor. 2017-09-20 23:25:19 -07:00
jonkykong 09070849d8 Formatting. 2017-09-20 22:54:04 -07:00
jonkykong 8705078fa5 Support for UISplitViewControllers when pushing view controllers. 2017-09-20 22:51:40 -07:00
jonkykong 48a39b4573 These methods will never be called as they are handled by the topViewController. 2017-09-20 22:50:23 -07:00
jonkykong 3611a6f5b8 Neglected to use menuDismissOnPush switch in code. 2017-09-20 22:49:30 -07:00
jonkykong 701d482714 Fixes to maintain iOS 11 animation smoothness. 2017-09-20 22:48:39 -07:00
jonkykong 9574c37479 Refactor. 2017-09-20 22:48:14 -07:00
jonkykong 52faf9a7e1 Changed MainViewController's scrollview to align to the topLayoutGuide. 2017-09-20 22:47:56 -07:00
Ranjithkumar Matheswaran 05a3659255 Fix for Swift 4 and version 2.3.4 2017-08-31 18:30:48 +05:30
Mark Woollard ef0c5fceed Add missing designated initialiser to UITableViewVibrantCell
So cell can be registered with UITableView without subclassing for simple use cases. Without this initialiser dequeuing instance of the cell will cause a crash.
2017-08-18 10:36:38 +01:00
Alex Kozin eab7e274e8 Set right menu width equal half of left menu width in example 2017-07-20 18:16:59 +07:00
Alex Kozin f9ec208e36 Add supporting of different left and right menu width 2017-07-20 18:16:01 +07:00
Jon Kent 6b9607fc9a Update README.md 2017-07-02 12:33:44 -07:00
jonkykong 8ad4b3a4d9 Revert README for Github. 2017-06-30 16:56:34 -07:00
jonkykong b0357d3f54 Merge tag '2.3.3'
* tag '2.3.3':
  Updated podspec and README.
  Added menuDismissOnPush property.
  Fix for single menu setups losing ability to swipe menu if wrong side is swiped.
2017-06-30 16:51:36 -07:00
jonkykong 7a30c5441e Updated podspec and README. 2017-06-30 16:50:04 -07:00
jonkykong 13e3d504f1 Added menuDismissOnPush property. 2017-06-30 16:48:19 -07:00
jonkykong 02578a894a Fix for single menu setups losing ability to swipe menu if wrong side is swiped. 2017-06-30 16:45:15 -07:00
Jon Kent 2e54a9d21a Create ISSUE_TEMPLATE.md 2017-06-08 01:45:53 -07:00
jonkykong d31f4419e1 Merge tag '2.3.2'
* tag '2.3.2':
  README edit.
  Updated podspec and README for cocoa pods.

Updated README for Github.
2017-04-26 12:44:34 -07:00
jonkykong 7bf1668184 README edit. 2017-04-26 12:38:24 -07:00
jonkykong e12faa68c9 Updated podspec and README for cocoa pods. 2017-04-26 12:37:10 -07:00
jonkykong ecebaca9b9 Logic correction. 2017-04-26 12:21:58 -07:00
jonkykong aeb660b02f Fix for menu not restoring when background on iPad in iOS 10. 2017-04-26 12:21:45 -07:00
jonkykong e6eb28385c Merge tag '2.3.1'
* tag '2.3.1':
  Updated pod spec and README for Cocoapods.
  Updated project settings.
  Reverting old logic that kept the layout correct when presenting a sub-screen.
  Subtle tweak if a larger transform is used on the main view controller when menu is presented (edge case).
  Fix for disabling gestures. Gestures were being added multiple times preventing all of them from being disabled when the menuEnableSwipeGestures was used.
2017-04-11 03:48:47 -07:00
jonkykong f9f8fd7817 Updated pod spec and README for Cocoapods. 2017-04-11 03:44:32 -07:00
jonkykong dda720eee7 Updated project settings. 2017-04-11 03:41:51 -07:00
jonkykong 8bb2505b6f Reverting old logic that kept the layout correct when presenting a sub-screen. 2017-04-11 03:41:13 -07:00
jonkykong 2878eea03f Subtle tweak if a larger transform is used on the main view controller when menu is presented (edge case). 2017-04-11 03:40:28 -07:00
jonkykong 7512cb9373 Fix for disabling gestures. Gestures were being added multiple times preventing all of them from being disabled when the menuEnableSwipeGestures was used. 2017-04-11 03:35:54 -07:00
Jon Kent 189586d8e8 Update CONTRIBUTING.md 2017-04-04 01:06:08 -07:00
Jon Kent f4d78af501 Update README.md 2017-03-28 11:57:24 -07:00
Jon Kent af2ef21f88 Update README.md 2017-03-26 13:36:39 -07:00
Jon Kent 25b87e4780 Update README.md 2017-03-07 12:23:00 -08:00
jonkykong c966675305 Revert README for Github. 2017-03-06 02:55:15 -08:00
jonkykong b0dfba206c Merge tag '2.3.0'
* tag '2.3.0':
  Updated README and podspec.
  Fix for tapView to not be sized to main screen which may be transformed and therefor hard to touch.
  Support for in-call status bar height change.
  Refactoring.
  Updated demo project to show various SideMenu events.
  Logic simplification.
  Removal of no longer needed logic.
  Updated comments and minor refactor.
  Fix for keyboard animations being confused during SideMenu display.
  Updated documentation.
  Fix deprecation warnings in swift 3.1
2017-03-06 02:54:35 -08:00
jonkykong 8960d3b4df Updated README and podspec. 2017-03-06 02:48:18 -08:00
jonkykong 05a117655b Fix for tapView to not be sized to main screen which may be transformed and therefor hard to touch. 2017-03-06 02:42:37 -08:00
jonkykong 5ed24a978e Support for in-call status bar height change. 2017-03-06 02:41:24 -08:00
jonkykong 330ea36ce5 Refactoring. 2017-03-06 02:40:06 -08:00
jonkykong 05d934d084 Updated demo project to show various SideMenu events. 2017-03-06 02:00:05 -08:00
jonkykong a520e98dbe Logic simplification. 2017-03-06 01:59:13 -08:00
jonkykong e49d564a2f Removal of no longer needed logic. 2017-03-06 01:57:00 -08:00
jonkykong 632c35509b Updated comments and minor refactor. 2017-03-06 01:56:07 -08:00
jonkykong b0a40b6fcf Fix for keyboard animations being confused during SideMenu display. 2017-03-06 01:55:00 -08:00
jonkykong 3d86c530ee Updated documentation. 2017-03-06 01:53:49 -08:00
Josh Friend 4983a468c5 Fix deprecation warnings in swift 3.1 2017-02-17 08:41:31 -05:00
Jon Kent bfbe4d21bf Update README.md 2017-02-13 12:04:40 -08:00
Jon Kent 615ff0e391 Update ISSUE_TEMPLATE.md 2017-02-07 23:35:10 -08:00
Jon Kent bdb9e4b3ae Update README.md 2017-02-04 19:30:54 -08:00
Jon Kent 1c7d834c63 Update CONTRIBUTING.md 2017-01-30 16:02:46 -08:00
Jon Kent 2e5ee04587 Update CONTRIBUTING.md 2017-01-30 04:20:31 -08:00
Jon Kent 806a7dd1c7 Update CONTRIBUTING.md 2017-01-29 14:10:34 -08:00
Jon Kent 094586042f Update CONTRIBUTING.md 2017-01-29 14:00:45 -08:00
Jon Kent e919cd5b56 Update README.md 2017-01-27 11:18:43 -08:00
Jon Kent e79169e735 Update README.md 2017-01-26 13:57:46 -08:00
Jon Kent a43fbb64f8 Update README.md 2017-01-25 23:20:52 -08:00
Jon Kent 275e01bdfd Update README.md 2017-01-25 22:48:09 -08:00
jonkykong 98da8fefc1 Update README for Github. 2017-01-24 21:40:17 -08:00
jonkykong b68fa60439 Merge tag '2.2.0'
* tag '2.2.0': (23 commits)
  Remove unused variable.
  Update README for Cocoapods.
  Update podspec.
  Updated README.
  Update comment.
  Additional debug warnings to help troubleshoot common problems.
  Refactoring.
  Tighter logic for responding to only a single gesture to avoid conflicts.
  New properties for further customizing non-interactive menu animations.
  Some refactoring and added in .subMenu to the list of behaviors.
  Documentation - added note about .replace hiding the back button.
  deprecation function simplification for .replace and .popifpossible
  updated readme and fixed indentation issues
  Enum changed / new "hide back button" behaviors
  updated documentation (disables back button)
  Default for "PreserveViewOnPush" is now to always disable the back button.
  When I thought I included the animation in the last commit, I did it in my own test project lol 00ps. Animation default now included as well as disable nav back button.
  removed menuTab option and set default action to always hide SideMenu when transitioning to new view. Refactored menuPreserveViewOnPush to match syntax and efficiency
  implemented changed to menuPreserveViewOnPush filter, now instead matching syntax with type(of: )
  last indentation fix
  ...
2017-01-24 21:39:42 -08:00
jonkykong 8f4e9ee214 Remove unused variable. 2017-01-24 21:31:42 -08:00
jonkykong bac8e1591d Update README for Cocoapods. 2017-01-24 21:27:31 -08:00
jonkykong 4ed14e7856 Update podspec. 2017-01-24 21:25:07 -08:00
jonkykong 60157eb001 Updated README. 2017-01-24 21:24:50 -08:00
jonkykong 743deb7e03 Update comment. 2017-01-24 21:23:58 -08:00
jonkykong 8f26bbb2d9 Additional debug warnings to help troubleshoot common problems. 2017-01-24 21:20:27 -08:00
jonkykong 192ef476bd Refactoring. 2017-01-24 21:19:59 -08:00
jonkykong 8fbf4002ac Tighter logic for responding to only a single gesture to avoid conflicts. 2017-01-24 21:19:26 -08:00
jonkykong 63e0b2b11b New properties for further customizing non-interactive menu animations. 2017-01-24 21:17:52 -08:00
jonkykong f371f0a7ee Merge branch 'pr/135' into 2.2.0
* pr/135:
  Some refactoring and added in .subMenu to the list of behaviors.
  Documentation - added note about .replace hiding the back button.
  deprecation function simplification for .replace and .popifpossible
  updated readme and fixed indentation issues
  Enum changed / new "hide back button" behaviors
  updated documentation (disables back button)
  Default for "PreserveViewOnPush" is now to always disable the back button.
  When I thought I included the animation in the last commit, I did it in my own test project lol 00ps. Animation default now included as well as disable nav back button.
  removed menuTab option and set default action to always hide SideMenu when transitioning to new view. Refactored menuPreserveViewOnPush to match syntax and efficiency
  implemented changed to menuPreserveViewOnPush filter, now instead matching syntax with type(of: )
  last indentation fix
  more stupid indentation issues fixed
  fixed spacing / indentation issues
  forked and added changes (tab feature and restore view controller feature)
2017-01-24 21:15:36 -08:00
jonkykong fbb692cd61 Some refactoring and added in .subMenu to the list of behaviors. 2017-01-24 21:14:55 -08:00
Jon Kent 78e6655363 Update README.md 2017-01-23 11:15:13 -08:00
Jon Kent a18d25d409 Update README.md 2017-01-23 10:36:27 -08:00
Jon Kent 422fbb72b0 Update ISSUE_TEMPLATE.md 2017-01-22 14:13:26 -08:00
Jon Kent adb5f861e4 Update CONTRIBUTING.md 2017-01-22 13:59:42 -08:00
Jon Kent 89d724cca0 Update README.md 2017-01-20 17:14:32 -08:00
agates4 08145abacb Documentation - added note about .replace hiding the back button. 2017-01-20 18:59:38 -05:00
agates4 b37bae8a02 deprecation function simplification for .replace and .popifpossible 2017-01-20 18:52:20 -05:00
agates4 52960fac95 updated readme and fixed indentation issues 2017-01-20 18:50:04 -05:00
agates4 72d998b184 Enum changed / new "hide back button" behaviors 2017-01-20 18:40:46 -05:00
Jon Kent f29ad608f7 Update README.md 2017-01-20 14:57:06 -08:00
Jon Kent 3ff92c69e6 Update README.md 2017-01-20 14:55:38 -08:00
agates4 c3a50dac9b updated documentation (disables back button) 2017-01-20 13:57:02 -05:00
agates4 93dacf7b1d Default for "PreserveViewOnPush" is now to always disable the back button. 2017-01-20 13:54:47 -05:00
agates4 5ff4caff44 When I thought I included the animation in the last commit, I did it in my own test project lol 00ps. Animation default now included as well as disable nav back button. 2017-01-20 13:53:16 -05:00
agates4 4656a951a2 removed menuTab option and set default action to always hide SideMenu when transitioning to new view. Refactored menuPreserveViewOnPush to match syntax and efficiency 2017-01-19 16:54:20 -05:00
agates4 18e1f751e8 implemented changed to menuPreserveViewOnPush filter, now instead matching syntax with type(of: ) 2017-01-19 15:21:30 -05:00
agates4 513d9603b2 last indentation fix 2017-01-19 14:26:25 -05:00
agates4 142d57e84c more stupid indentation issues fixed 2017-01-19 14:25:46 -05:00
agates4 f15081a31b fixed spacing / indentation issues 2017-01-19 14:23:47 -05:00
agates4 4c04c841c3 forked and added changes (tab feature and restore view controller feature) 2017-01-19 14:18:58 -05:00
jonkykong f6bf6972e9 Update README for GitHub. 2017-01-12 14:21:30 -08:00
jonkykong 02f643a667 Merge tag '2.1.5'
* tag '2.1.5':
  Update README for Cocoapods.
  Update pod spec.
  Refactoring.
  Second fix for multiple gestures actuating and causing problem.
2017-01-12 14:20:44 -08:00
jonkykong a1716035c3 Update README for Cocoapods. 2017-01-12 14:17:04 -08:00
jonkykong 99456afaed Update pod spec. 2017-01-12 14:16:49 -08:00
jonkykong 4b92f5a776 Refactoring. 2017-01-12 14:14:05 -08:00
jonkykong 459a4a1e9f Second fix for multiple gestures actuating and causing problem. 2017-01-12 14:13:43 -08:00
jonkykong 717fd3a325 Update README for GitHub. 2017-01-10 13:13:59 -08:00
jonkykong 802146708e Merge tag '2.1.4'
* tag '2.1.4':
  Silence warning.
  Update README for Cocoapods.
  Update podspec.
  Fix for multiple gestures causing crashes when presenting or dismissing menu. SideMenuTransition is due for a refactoring of logic to simplify that I don’t have time for now.
  Update to Launch Screen.
  Say “SideMenu” instead of “Example” in demo project.
2017-01-10 13:13:04 -08:00
jonkykong f34452d040 Updating README for GitHub. 2017-01-09 12:49:17 -08:00
jonkykong bda990bbef Silence warning. 2017-01-09 12:41:27 -08:00
jonkykong b8f13dc333 Update README for Cocoapods. 2017-01-09 12:36:07 -08:00
jonkykong 793ffd77bc Update podspec. 2017-01-09 12:35:09 -08:00
jonkykong 132a50766e Fix for multiple gestures causing crashes when presenting or dismissing menu. SideMenuTransition is due for a refactoring of logic to simplify that I don’t have time for now. 2017-01-09 12:34:10 -08:00
jonkykong 85f00c63b4 Update to Launch Screen. 2017-01-09 12:32:11 -08:00
jonkykong e71ec145f1 Say “SideMenu” instead of “Example” in demo project. 2017-01-09 12:31:44 -08:00
jonkykong 37b0f6d57e Update README for GitHub. 2017-01-06 23:21:25 -08:00
jonkykong ccee3e1f83 Merge tag '2.1.3'
* tag '2.1.3':
  Update podspec and README for Cocoapods.
  Cleaner version of logic proposed by @saltyskip.
  adding possibility of tab bar or nav bar
  make tab bar controller
2017-01-06 23:17:38 -08:00
jonkykong 1786b459c5 Update podspec and README for Cocoapods. 2017-01-06 23:14:40 -08:00
jonkykong 5f5fdcba7a Merge branch 'pr/125' into 2.1.3
* pr/125:
  Cleaner version of logic proposed by @saltyskip.
  adding possibility of tab bar or nav bar
  make tab bar controller
2017-01-06 23:12:43 -08:00
jonkykong 27f490435e Cleaner version of logic proposed by @saltyskip. 2017-01-06 23:11:50 -08:00
Jon Kent 96dd886575 Update ISSUE_TEMPLATE.md 2017-01-04 11:03:59 -08:00
andrei 5b4b6afdbe adding possibility of tab bar or nav bar 2017-01-04 18:34:20 +09:00
andrei fa6f9eb9e1 make tab bar controller 2017-01-04 17:54:29 +09:00
Jon Kent 0c3aaa471d Update README.md 2016-12-30 17:59:42 -08:00
jonkykong f184415f7c Ready correction. 2016-12-28 18:34:08 -06:00
jonkykong 1c883abf55 Updated readme for Github. 2016-12-28 15:08:25 -06:00
jonkykong f82138dc87 Merge tag '2.1.2'
* tag '2.1.2':
  Updated podspec/readme.
  Removed redundant copies of source files causing confusion with updating cocoa pods. Replaced with links to pod files. Unsure if this will break Carthage.
  Cocoapods still not updating. Updating podspec in prep for next workaround.
  Reversing edit.
  Making frivolous change to file not updating to attempt redetection.
  Cocoapods still not updating. Updated podspec.
  Cocoapods does not appear to have updated… retrying.
2016-12-28 15:08:06 -06:00
jonkykong 56f5270405 Updated podspec/readme. 2016-12-28 15:02:05 -06:00
jonkykong 0c1086a9da Removed redundant copies of source files causing confusion with updating cocoa pods. Replaced with links to pod files. Unsure if this will break Carthage. 2016-12-28 14:46:38 -06:00
jonkykong 138a13bd60 Cocoapods still not updating. Updating podspec in prep for next workaround. 2016-12-28 14:13:51 -06:00
jonkykong 430fad0568 Reversing edit. 2016-12-28 14:08:35 -06:00
jonkykong d8d19b6207 Making frivolous change to file not updating to attempt redetection. 2016-12-28 14:08:19 -06:00
jonkykong eaa6d2f86f Cocoapods still not updating. Updated podspec. 2016-12-28 14:07:57 -06:00
jonkykong 2a35158c3c Cocoapods does not appear to have updated… retrying. 2016-12-28 13:49:52 -06:00
jonkykong 9f454c8fc9 Update readme for Github. 2016-12-28 13:18:25 -06:00
jonkykong fedff5a09e Merge tag '2.0.8'
* tag '2.0.8':
  Updated pod spec/readme.
  Updated project settings.
  Refactor of logic for menuEnableSwipeGestures so it won’t conflict with swipe based controls (UISlider) in menu.
2016-12-28 13:18:05 -06:00
jonkykong 065e6e236e Updated pod spec/readme. 2016-12-28 13:04:30 -06:00
jonkykong 143a8cdde9 Updated project settings. 2016-12-28 13:01:46 -06:00
jonkykong cadb63bf21 Merge branch 'master' into 2.0.8
* master:
  Update CONTRIBUTING.md
  Update README.md
  Update README.md
  Update ISSUE_TEMPLATE.md
  Update ISSUE_TEMPLATE.md
  Update ISSUE_TEMPLATE.md
  Create ISSUE_TEMPLATE.md
  Create CONTRIBUTING.md
  Silence warning of unused variable.
2016-12-28 12:59:59 -06:00
jonkykong 6903ffb958 Refactor of logic for menuEnableSwipeGestures so it won’t conflict with swipe based controls (UISlider) in menu. 2016-12-28 12:56:55 -06:00
Jon Kent ac5c1eaba6 Update CONTRIBUTING.md 2016-12-21 12:27:10 -06:00
Jon Kent db4eb5380d Update README.md 2016-12-17 20:04:56 -08:00
Jon Kent 5d08277cd4 Update README.md 2016-12-15 11:49:09 -08:00
Jon Kent 2798c61d73 Update ISSUE_TEMPLATE.md 2016-12-14 20:54:40 -08:00
Jon Kent 8037148fd2 Update ISSUE_TEMPLATE.md 2016-12-14 20:54:18 -08:00
Jon Kent 2b8e46d503 Update ISSUE_TEMPLATE.md 2016-12-14 20:46:55 -08:00
Jon Kent 49841b0b4e Create ISSUE_TEMPLATE.md 2016-12-14 20:41:46 -08:00
Jon Kent 516e845da7 Create CONTRIBUTING.md 2016-12-14 20:20:04 -08:00
jonkykong 0fe8e5a052 Silence warning of unused variable. 2016-12-09 16:40:49 -08:00
jonkykong 589c6e7a91 Cleaned up storyboard. 2016-12-09 16:39:33 -08:00
jonkykong 298c7744a3 Updated pod spec. 2016-12-09 16:32:15 -08:00
Jon Kent b59210bc6a Update README.md 2016-12-09 16:29:34 -08:00
jonkykong 1ee6ce53fc Added menuReplaceOnPush property. 2016-12-09 16:25:05 -08:00
jonkykong 76287726b7 Fix for crash when menu is presenting an alert and app is backgrounded. 2016-12-09 15:30:29 -08:00
Andre Santana Ferreira 6046365e13 Issue #102 - Test 2016-11-21 11:46:04 -02:00
Andre Santana Ferreira dcb562bb1d issue #102 - Test Fail - imports removed 2016-11-21 11:02:40 -02:00
Andre Santana Ferreira bd9eb3ed10 Issue #102 - Test - Import SideMenu classes to SideMenu.h 2016-11-21 10:59:18 -02:00
Andre Santana Ferreira 53e337ab93 Issue #102 - SideMenu.h included in BuildPhases/Headers 2016-11-21 10:37:23 -02:00
Andre Santana Ferreira be430cd22b Issue #102 - .modulemap updated to SideMenu 2016-11-21 10:33:01 -02:00
Andre Santana Ferreira 68d3addeb2 Issue #102 - Carthage Building scheme 2016-11-21 10:30:47 -02:00
Andre Santana Ferreira 69eecb1739 modulemap configured 2016-11-21 10:24:26 -02:00
Andre Santana Ferreira fe6a635df5 README.md deleted from Compile Source to Copy Bundle Resources 2016-11-21 10:11:09 -02:00
Andre Santana Ferreira a25a10cec6 Issue #102 - Shared Scheme to use Carthage 2016-11-21 10:02:38 -02:00
Jon Kent 6c9b6ccf6e Update README.md 2016-11-20 17:50:17 -08:00
Jon Kent 5b747c787b Update README.md 2016-11-10 01:26:01 -08:00
jonkykong b1e4bdfe69 Update README for Github. 2016-11-10 01:15:24 -08:00
18 changed files with 1733 additions and 606 deletions
+23
View File
@@ -0,0 +1,23 @@
# Contribution Guidelines
Thank you for your interest in SideMenu!
I have received a surprising amount of questions about SideMenu since putting it up here. A few people in the community have identified some problems and helped contribute to SideMenu to make it better for everyone and I'm truly grateful for the support! Keep them coming!
I have also received a number of questions about people having issues implementing SideMenu, mostly from beginners learning how to code. As much as I would love to help all of you, **I do not have time to teach you**. I am only supporting bugfixes or reviewing pull requests.
I spent a lot of time putting together a detailed [README](https://github.com/jonkykong/SideMenu/blob/master/README.md), adding comments about usage in code, and provided a [demo project](https://github.com/jonkykong/SideMenu/tree/master/Example). These will give you all the information you need to work through any problem, **saving _you_ the time it takes for me to personally respond.**
### If your question begins with _"How do I..."_
- That's **not** a bug. Go back through the [README](https://github.com/jonkykong/SideMenu/blob/master/README.md). Check out the [demo project](https://github.com/jonkykong/SideMenu/tree/master/Example). Stay persistent, try a few different things, and you will figure it out! **It is generally faster for you to figure it out for yourself instead of waiting for me to respond to you.** I also recommend searching and posting your questions on [stackoverflow.com](stackoverflow.com). If you're interested in hiring me to teach you, please email me using the email address listed at the top of my [README](https://github.com/jonkykong/SideMenu/blob/master/README.md).
### If your question begins with _"How can I..."_
- That's a **new feature request**. I am no longer investing my personal time to implement one-off features because SideMenu currently meets the majority of people's needs with the features it already has. However, this is a great opportunity for you to [join the proud members](https://github.com/jonkykong/SideMenu/graphs/contributors) who have contributed to this open source project! Feel free to open an issue to ask any clarifying questions for your new feature before you start building. Open a [pull request](https://github.com/jonkykong/SideMenu/pull/new/master) when you're ready for me to merge it.
### If your question is about SideMenu not working the way it's described in the [README](https://github.com/jonkykong/SideMenu/blob/master/README.md)...
- This *may* be a bug. You must be able to reproduce the bug in the [demo project](https://github.com/jonkykong/SideMenu/tree/master/Example) which has a minimal amount of code. This helps ensure you don't have a bug in your code unrelated to SideMenu. If the bug is reproducable, open an issue and I will respond to it when I find time.
**Again**, please do **not** email me or open any issues if you want to know how to use SideMenu or are having trouble getting it to behave a specific way not described in the [README](https://github.com/jonkykong/SideMenu/blob/master/README.md). I am not **tech support**. I am not a **teacher**. If you open an issue while failing to follow these guidelines or use the provided templates your **request for help will be ignored**.
### Thanks again for your support and for being respectful of my time.
I apologize if this seems harsh, but there have been too many developers that have willfully ignored all of this and continued to contact me.
+12
View File
@@ -0,0 +1,12 @@
<!--- IF YOU DELETE OR IGNORE THIS TEMPLATE YOUR ISSUE WILL BE IGNORED AND CLOSED -->
## New Issue Checklist
<!--- Please complete all of the checks below before submitting a new issue (complete a check by marking it [x] with no spaces) -->
I have read the [guidelines for contributing](https://github.com/jonkykong/SideMenu/blob/master/.github/CONTRIBUTING.md) and I understand:
- [ ] My issue is happening in the **latest version** of SideMenu.
- [ ] My issue was **not** solved in the [README](https://github.com/jonkykong/SideMenu/blob/master/README.md).
- [ ] My issue can **not** be answered on [stackoverflow.com](stackoverflow.com).
- [ ] My issue is **not** a request for new functionality that I am unwilling to build and contribute with a pull request.
- [ ] My issue **is** reproducible in the [demo project](https://github.com/jonkykong/SideMenu/tree/master/Example).
## Issue Description
<!--- After completing all of the checks above, describe the issue here -->
+46
View File
@@ -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/
+2
View File
@@ -4,6 +4,8 @@
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>SideMenu</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
+10 -4
View File
@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<?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">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@@ -18,12 +22,14 @@
<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 jonkykong. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd">
<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"/>
+69 -48
View File
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="yAA-s6-Bam">
<?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">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@@ -12,7 +15,7 @@
<objects>
<navigationController id="yAA-s6-Bam" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" barStyle="black" id="Bue-4e-bCJ">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<gestureRecognizers/>
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -29,42 +32,49 @@
<!--Swipe Here-->
<scene sceneID="XZh-dw-B7D">
<objects>
<viewController id="QHN-nZ-kbB" customClass="MainViewController" customModule="SideMenu_Example" customModuleProvider="target" sceneMemberID="viewController">
<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="320" height="568"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LFJ-SB-Zp9">
<rect key="frame" x="0.0" y="64" width="375" height="571"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DMn-tw-NTB">
<rect key="frame" x="0.0" y="0.0" width="375" height="469"/>
<subviews>
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="pqT-4M-nw1">
<rect key="frame" x="18" y="167" width="339" height="31"/>
<color key="thumbTintColor" red="0.25098040700000002" green="0.0" blue="0.50196081400000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<action selector="changeSlider:" destination="QHN-nZ-kbB" eventType="valueChanged" id="Kcj-yD-lS0"/>
</connections>
</slider>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Menu Present Mode" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Efp-5L-qft">
<rect key="frame" x="20" y="8" width="154" height="20.5"/>
<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" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Menu Screen Width" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Snj-Mg-6ww">
<rect key="frame" x="20" y="272" width="151" height="20.5"/>
<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>
<slider opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="Osf-2d-Znm">
<rect key="frame" x="18" y="234" width="339" height="31"/>
<color key="thumbTintColor" red="0.25098040700000002" green="0.0" blue="0.50196081400000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<action selector="changeSlider:" destination="QHN-nZ-kbB" eventType="valueChanged" id="cRR-z8-cmm"/>
</connections>
</slider>
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" translatesAutoresizingMaskIntoConstraints="NO" id="owH-AA-wgw">
<rect key="frame" x="20" y="102" width="335" height="29"/>
<segments>
<segment title="None"/>
<segment title="Dark"/>
@@ -76,49 +86,58 @@
</connections>
</segmentedControl>
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.001" minValue="0.001" maxValue="2" translatesAutoresizingMaskIntoConstraints="NO" id="Xp9-C5-Td1">
<rect key="frame" x="18" y="368" width="339" height="31"/>
<color key="thumbTintColor" red="0.25098040700000002" green="0.0" blue="0.50196081400000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<action selector="changeSlider:" destination="QHN-nZ-kbB" eventType="valueChanged" id="PMM-8h-apN"/>
</connections>
</slider>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Menu Shadow Opacity" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2QC-6F-Xpx">
<rect key="frame" x="20" y="205" width="172.5" height="20.5"/>
<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>
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="Cor-r1-osR">
<rect key="frame" x="18" y="301" width="339" height="31"/>
<color key="thumbTintColor" red="0.25098040700000002" green="0.0" blue="0.50196081400000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<action selector="changeSlider:" destination="QHN-nZ-kbB" eventType="valueChanged" id="TSE-rt-Run"/>
</connections>
</slider>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Menu Transform Scale Factor" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Tsg-30-YHs">
<rect key="frame" x="20" y="339" width="225" height="20.5"/>
<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" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Menu Blur Style" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="OHe-SA-S0e">
<rect key="frame" x="20" y="73" width="120.5" height="20.5"/>
<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" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Menu Fade Strength" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tRs-iN-9Ht">
<rect key="frame" x="20" y="138" width="155.5" height="20.5"/>
<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" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Menu Fade Status Bar" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Gtc-KE-FIO">
<rect key="frame" x="20" y="423.5" width="168.5" height="20.5"/>
<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>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="oFS-2Q-kPB">
<rect key="frame" x="306" y="418" width="51" height="31"/>
<color key="onTintColor" red="0.25098040700000002" green="0.0" blue="0.50196081400000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<action selector="changeSwitch:" destination="QHN-nZ-kbB" eventType="valueChanged" id="2wD-Py-Q4n"/>
</connections>
</switch>
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" translatesAutoresizingMaskIntoConstraints="NO" id="KV2-tN-Aff">
<rect key="frame" x="20" y="37" width="335" height="29"/>
<segments>
<segment title="Slide In"/>
<segment title="Slide Out"/>
@@ -178,6 +197,7 @@
</constraints>
</scrollView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="← Swipe Screen Edges in View →" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ma4-O6-wOT">
<rect key="frame" x="87.5" y="643" width="200.5" height="16"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
@@ -185,9 +205,9 @@
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="LFJ-SB-Zp9" firstAttribute="top" secondItem="0gg-po-Ih1" secondAttribute="topMargin" id="0T7-Dc-CaB"/>
<constraint firstItem="LFJ-SB-Zp9" firstAttribute="leading" secondItem="0gg-po-Ih1" secondAttribute="leading" id="OsA-4z-Y7t"/>
<constraint firstItem="ma4-O6-wOT" firstAttribute="top" secondItem="LFJ-SB-Zp9" secondAttribute="bottom" constant="8" id="UUi-lo-0RA"/>
<constraint firstItem="LFJ-SB-Zp9" firstAttribute="top" secondItem="Rm7-bv-OCN" secondAttribute="bottom" id="W6M-QX-I2w"/>
<constraint firstItem="ma4-O6-wOT" firstAttribute="centerX" secondItem="0gg-po-Ih1" secondAttribute="centerX" id="aia-PT-OH3"/>
<constraint firstItem="LW0-9z-RHu" firstAttribute="top" secondItem="ma4-O6-wOT" secondAttribute="bottom" constant="8" id="d5Q-Sj-0Xz"/>
<constraint firstItem="LFJ-SB-Zp9" firstAttribute="top" secondItem="Rm7-bv-OCN" secondAttribute="bottom" id="ssi-ps-a2k"/>
@@ -203,7 +223,7 @@
<barButtonItem key="backBarButtonItem" title=" " id="FVG-mn-9HX"/>
<barButtonItem key="leftBarButtonItem" title="Left Menu" id="hjJ-My-xDQ">
<connections>
<segue destination="DuX-EW-0mP" kind="presentation" identifier="Test" id="yoa-B2-xG5"/>
<segue destination="DuX-EW-0mP" kind="presentation" identifier="" id="yoa-B2-xG5"/>
</connections>
</barButtonItem>
<barButtonItem key="rightBarButtonItem" title="Right Menu" id="ckn-oO-hhX">
@@ -232,7 +252,6 @@
<navigationController storyboardIdentifier="LeftMenuNavigationController" navigationBarHidden="YES" id="DuX-EW-0mP" customClass="UISideMenuNavigationController" customModule="SideMenu" sceneMemberID="viewController">
<navigationItem key="navigationItem" id="ipz-Lx-Wgf"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="35F-wh-r6h">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<userDefinedRuntimeAttributes>
@@ -246,18 +265,18 @@
</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="SideMenu_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="320" height="568"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<color key="tintColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<inset key="separatorInset" minX="15" minY="0.0" maxX="8" maxY="0.0"/>
<view key="tableFooterView" contentMode="scaleToFill" id="vVB-ag-TnU">
<rect key="frame" x="0.0" y="132" width="320" height="0.0"/>
<rect key="frame" x="0.0" y="132" width="375" height="0.0"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
@@ -265,14 +284,14 @@
<tableViewSection id="gP8-eA-dcW">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" textLabel="4WI-Ed-3Gr" style="IBUITableViewCellStyleDefault" id="7tx-O6-zAs" customClass="UITableViewVibrantCell" customModule="SideMenu">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="7tx-O6-zAs" id="K0u-J2-Ab7">
<frame key="frameInset" width="320" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<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">
<frame key="frameInset" minX="15" width="290" height="43"/>
<rect key="frame" x="15" y="0.0" width="345" 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"/>
@@ -286,14 +305,14 @@
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" textLabel="DpJ-hV-lmw" style="IBUITableViewCellStyleDefault" id="f9Q-QP-TZ6" customClass="UITableViewVibrantCell" customModule="SideMenu">
<rect key="frame" x="0.0" y="44" width="320" height="44"/>
<rect key="frame" x="0.0" y="44" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="f9Q-QP-TZ6" id="i3p-Ya-AvO">
<frame key="frameInset" width="320" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<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">
<frame key="frameInset" minX="15" width="290" height="43"/>
<rect key="frame" x="15" y="0.0" width="345" 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"/>
@@ -307,14 +326,14 @@
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" textLabel="mAf-mx-C48" style="IBUITableViewCellStyleDefault" id="dc6-l8-0cu" customClass="UITableViewVibrantCell" customModule="SideMenu">
<rect key="frame" x="0.0" y="88" width="320" height="44"/>
<rect key="frame" x="0.0" y="88" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="dc6-l8-0cu" id="gyo-JQ-fx5">
<frame key="frameInset" width="320" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<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">
<frame key="frameInset" minX="15" width="290" height="43"/>
<rect key="frame" x="15" y="0.0" width="345" 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"/>
@@ -344,13 +363,13 @@
<!--You Can Still Swipe!-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="PresentedViewController" customModule="SideMenu_Example" customModuleProvider="target" sceneMemberID="viewController">
<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="320" height="568"/>
<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"/>
</view>
@@ -367,7 +386,6 @@
<objects>
<navigationController storyboardIdentifier="RightMenuNavigationController" navigationBarHidden="YES" id="z7k-fk-pfc" customClass="UISideMenuNavigationController" customModule="SideMenu" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="qOd-yQ-2i8">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
@@ -378,17 +396,17 @@
</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="SideMenu_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="320" height="568"/>
<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.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<inset key="separatorInset" minX="0.0" minY="0.0" maxX="15" maxY="0.0"/>
<view key="tableFooterView" contentMode="scaleToFill" id="UXT-t2-k90">
<rect key="frame" x="0.0" y="132" width="320" height="0.0"/>
<rect key="frame" x="0.0" y="132" width="375" height="0.0"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
@@ -396,14 +414,14 @@
<tableViewSection id="xTE-WH-UeX">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" textLabel="NLA-8t-ufi" style="IBUITableViewCellStyleDefault" id="8Ng-b4-4hH" customClass="UITableViewVibrantCell" customModule="SideMenu">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="8Ng-b4-4hH" id="U5K-l9-XWv">
<frame key="frameInset" width="320" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<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">
<frame key="frameInset" minX="15" width="290" height="43"/>
<rect key="frame" x="15" y="0.0" width="345" 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"/>
@@ -417,14 +435,14 @@
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" textLabel="IdU-2D-zHb" style="IBUITableViewCellStyleDefault" id="Eok-gX-LwQ" customClass="UITableViewVibrantCell" customModule="SideMenu">
<rect key="frame" x="0.0" y="44" width="320" height="44"/>
<rect key="frame" x="0.0" y="44" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Eok-gX-LwQ" id="IOJ-bC-bNt">
<frame key="frameInset" width="320" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<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">
<frame key="frameInset" minX="15" width="290" height="43"/>
<rect key="frame" x="15" y="0.0" width="345" 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"/>
@@ -438,14 +456,14 @@
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" textLabel="6x7-O7-DkG" style="IBUITableViewCellStyleDefault" id="41i-KK-YM3" customClass="UITableViewVibrantCell" customModule="SideMenu">
<rect key="frame" x="0.0" y="88" width="320" height="44"/>
<rect key="frame" x="0.0" y="88" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="41i-KK-YM3" id="629-G3-Agl">
<frame key="frameInset" width="320" height="43"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<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">
<frame key="frameInset" minX="15" width="290" height="43"/>
<rect key="frame" x="15" y="0.0" width="345" 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"/>
@@ -475,16 +493,17 @@
<!--Presented View Controller-->
<scene sceneID="1Bw-F8-wcb">
<objects>
<viewController id="uMV-sw-TbB" customClass="PresentedViewController" customModule="SideMenu_Example" customModuleProvider="target" sceneMemberID="viewController">
<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="320" height="568"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="TJh-vs-sd4">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<state key="normal" title="Dismiss">
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
@@ -516,16 +535,17 @@
<!--Presented View Controller-->
<scene sceneID="afw-j1-hgm">
<objects>
<viewController id="Upx-FH-Mbv" customClass="PresentedViewController" customModule="SideMenu_Example" customModuleProvider="target" sceneMemberID="viewController">
<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="320" height="568"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cKk-fD-whk">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<state key="normal" title="Dismiss">
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
@@ -557,16 +577,17 @@
<!--Presented View Controller-->
<scene sceneID="lxj-KK-fq7">
<objects>
<viewController id="EG7-2X-5hP" customClass="PresentedViewController" customModule="SideMenu_Example" customModuleProvider="target" sceneMemberID="viewController">
<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="320" height="568"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="a17-pq-WAQ">
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
<state key="normal" title="Dismiss">
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
@@ -598,13 +619,13 @@
<!--You Can Still Swipe!-->
<scene sceneID="6GP-Jo-SOW">
<objects>
<viewController id="u7M-mb-V6o" customClass="PresentedViewController" customModule="SideMenu_Example" customModuleProvider="target" sceneMemberID="viewController">
<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="320" height="568"/>
<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"/>
</view>
@@ -619,13 +640,13 @@
<!--You Can Still Swipe!-->
<scene sceneID="ZQL-2c-L6r">
<objects>
<viewController id="b5t-IX-0yu" customClass="PresentedViewController" customModule="SideMenu_Example" customModuleProvider="target" sceneMemberID="viewController">
<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="320" height="568"/>
<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"/>
</view>
+41 -20
View File
@@ -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 {
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]
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,5 +1,5 @@
//
// SideMenuTableView.swift
// SideMenuTableViewController.swift
// SideMenu
//
// Created by Jon Kent on 4/5/16.
@@ -9,13 +9,15 @@
import Foundation
import SideMenu
class SideMenuTableView: UITableViewController {
class SideMenuTableViewController: UITableViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// this will be non-nil if a blur effect is applied
guard tableView.backgroundView == nil else {
// refresh cell blur effect in case it changed
tableView.reloadData()
guard SideMenuManager.default.menuBlurEffectStyle == nil else {
return
}
@@ -26,4 +28,12 @@ class SideMenuTableView: UITableViewController {
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
}
}
+484 -93
View File
@@ -18,11 +18,20 @@
open class SideMenuManager : NSObject {
@objc public enum MenuPushStyle : Int {
case defaultBehavior,
popWhenPossible,
replace,
preserve,
preserveAndHideBackButton,
subMenu
}
@objc public enum MenuPresentMode : Int {
case menuSlideIn
case viewSlideOut
case viewSlideInOut
case menuDissolveIn
case menuSlideIn,
viewSlideOut,
viewSlideInOut,
menuDissolveIn
}
// Bounds which has been allocated for the app on the whole device screen
@@ -31,6 +40,19 @@ open class SideMenuManager : NSObject {
return appWindowRect
}
/**
The push style of the menu.
There are six modes in MenuPushStyle:
- defaultBehavior: The view controller is pushed onto the stack.
- popWhenPossible: If a view controller already in the stack is of the same class as the pushed view controller, the stack is instead popped back to the existing view controller. This behavior can help users from getting lost in a deep navigation stack.
- preserve: If a view controller already in the stack is of the same class as the pushed view controller, the existing view controller is pushed to the end of the stack. This behavior is similar to a UITabBarController.
- preserveAndHideBackButton: Same as .preserve and back buttons are automatically hidden.
- replace: Any existing view controllers are released from the stack and replaced with the pushed view controller. Back buttons are automatically hidden. This behavior is ideal if view controllers require a lot of memory or their state doesn't need to be preserved..
- subMenu: Unlike all other behaviors that push using the menu's presentingViewController, this behavior pushes view controllers within the menu. Use this behavior if you want to display a sub menu.
*/
open var menuPushStyle: MenuPushStyle = .defaultBehavior
/**
The presentation mode of the menu.
@@ -40,82 +62,89 @@ 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
/// Pops to any view controller already in the navigation stack instead of the view controller being pushed if they share the same class. Defaults to false.
open static var menuAllowPopIfPossible = false
/// 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)
open var menuAllowPushOfSameClassTwice = true
/**
Width of the menu when presented on screen, showing the existing view controller in the remaining space. Default is 75% of the screen width or 240 points, whichever is smaller.
Note that each menu's width can be overridden using the `menuWidth` property on any `UISideMenuNavigationController` instance.
*/
open var menuWidth: CGFloat = min(round(min((appScreenRect.width), (appScreenRect.height)) * 0.75), 240)
/// 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
/// The left menu swipe to dismiss gesture.
open static weak var menuLeftSwipeToDismissGesture: UIPanGestureRecognizer?
/// The right menu swipe to dismiss gesture.
open static weak var menuRightSwipeToDismissGesture: UIPanGestureRecognizer?
/// Enable or disable gestures that would swipe to present or dismiss the menu. Default is true.
open static var menuEnableSwipeGestures: Bool = true
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
/// When true, pushViewController called within the menu it will push the new view controller inside of the menu. Otherwise, it is pushed on the menu's presentingViewController. Default is false.
open static var menuAllowSubmenus: Bool = false
/// The animation options when a menu is displayed. Ignored when displayed with a gesture.
open var menuAnimationOptions: UIViewAnimationOptions = .curveEaseInOut
/// -Warning: Deprecated. Use `menuAnimationTransformScaleFactor` instead.
@available(*, deprecated, renamed: "menuAnimationTransformScaleFactor")
open static var menuAnimationShrinkStrength: CGFloat {
get {
return menuAnimationTransformScaleFactor
}
set {
menuAnimationTransformScaleFactor = newValue
}
/// The animation spring damping when a menu is displayed. Ignored when displayed with a gesture.
open var menuAnimationUsingSpringWithDamping: CGFloat = 1
/// The animation initial spring velocity when a menu is displayed. Ignored when displayed with a gesture.
open var menuAnimationInitialSpringVelocity: CGFloat = 1
/**
Automatically dismisses the menu when another view is pushed from it.
Note: to prevent the menu from dismissing when presenting, set modalPresentationStyle = .overFullScreen
of the view controller being presented in storyboard or during its initalization.
*/
open var menuDismissOnPush = true
/// 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.
open static let `default` = SideMenuManager()
internal var transition: SideMenuTransition!
public override init() {
super.init()
transition = SideMenuTransition(sideMenuManager: self)
}
// 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: UIBlurEffectStyle? {
didSet {
if oldValue != menuBlurEffectStyle {
updateMenuBlurIfNecessary()
@@ -124,30 +153,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
@@ -157,44 +196,95 @@ open class SideMenuManager : NSObject {
}
}
fileprivate class func setupNavigationController(_ forMenu: UISideMenuNavigationController?, leftSide: Bool) {
/// The left menu swipe to dismiss gesture.
open weak var menuLeftSwipeToDismissGesture: UIPanGestureRecognizer? {
didSet {
oldValue?.view?.removeGestureRecognizer(oldValue!)
setupGesture(gesture: menuLeftSwipeToDismissGesture)
}
}
/// The right menu swipe to dismiss gesture.
open weak var menuRightSwipeToDismissGesture: UIPanGestureRecognizer? {
didSet {
oldValue?.view?.removeGestureRecognizer(oldValue!)
setupGesture(gesture: menuRightSwipeToDismissGesture)
}
}
fileprivate func setupGesture(gesture: UIPanGestureRecognizer?) {
guard let gesture = gesture else {
return
}
gesture.addTarget(transition, action:#selector(SideMenuTransition.handleHideMenuPan(_:)))
}
fileprivate func setupNavigationController(_ forMenu: UISideMenuNavigationController?, leftSide: Bool) {
guard let forMenu = forMenu else {
return
}
let exitPanGesture = UIPanGestureRecognizer()
exitPanGesture.addTarget(SideMenuTransition.self, action:#selector(SideMenuTransition.handleHideMenuPan(_:)))
forMenu.view.addGestureRecognizer(exitPanGesture)
forMenu.transitioningDelegate = SideMenuTransition.singleton
forMenu.transitioningDelegate = transition
forMenu.modalPresentationStyle = .overFullScreen
forMenu.leftSide = leftSide
if leftSide {
menuLeftSwipeToDismissGesture = exitPanGesture
} else {
menuRightSwipeToDismissGesture = exitPanGesture
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
}
updateMenuBlurIfNecessary()
}
fileprivate class func updateMenuBlurIfNecessary() {
let menuBlurBlock = { (forMenu: UISideMenuNavigationController?) in
if let forMenu = forMenu {
setupMenuBlurForMenu(forMenu)
forMenu.locked = true
if menuEnableSwipeGestures {
let exitPanGesture = UIPanGestureRecognizer()
forMenu.view.addGestureRecognizer(exitPanGesture)
if leftSide {
menuLeftSwipeToDismissGesture = exitPanGesture
} else {
menuRightSwipeToDismissGesture = exitPanGesture
}
}
menuBlurBlock(menuLeftNavigationController)
menuBlurBlock(menuRightNavigationController)
// Ensures minimal lag when revealing the menu for the first time using gestures by loading the view:
let _ = forMenu.topViewController?.view
updateMenuBlurIfNecessary()
}
fileprivate class func setupMenuBlurForMenu(_ forMenu: UISideMenuNavigationController?) {
/// Enable or disable gestures that would swipe to dismiss the menu. Default is true.
open var menuEnableSwipeGestures: Bool = true {
didSet {
menuLeftSwipeToDismissGesture?.view?.removeGestureRecognizer(menuLeftSwipeToDismissGesture!)
menuRightSwipeToDismissGesture?.view?.removeGestureRecognizer(menuRightSwipeToDismissGesture!)
setupNavigationController(menuLeftNavigationController, leftSide: true)
setupNavigationController(menuRightNavigationController, leftSide: false)
}
}
fileprivate func updateMenuBlurIfNecessary() {
if let menuLeftNavigationController = self.menuLeftNavigationController {
setupMenuBlurForMenu(menuLeftNavigationController)
}
if let menuRightNavigationController = self.menuRightNavigationController {
setupMenuBlurForMenu(menuRightNavigationController)
}
}
fileprivate func setupMenuBlurForMenu(_ forMenu: UISideMenuNavigationController?) {
removeMenuBlurForMenu(forMenu)
guard let forMenu = forMenu,
let menuBlurEffectStyle = menuBlurEffectStyle,
let view = forMenu.visibleViewController?.view
, !UIAccessibilityIsReduceTransparencyEnabled() else {
return
let view = forMenu.topViewController?.view,
!UIAccessibilityIsReduceTransparencyEnabled() else {
return
}
if forMenu.originalMenuBackgroundColor == nil {
@@ -204,7 +294,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()
@@ -215,17 +305,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 {
return
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()
@@ -242,25 +332,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 !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 !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
@@ -273,11 +377,298 @@ 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 menuLeftNavigationController ?? menuRightNavigationController == nil {
print("SideMenu Warning: menuAddPanGestureToPresent called before menuLeftNavigationController or menuRightNavigationController have been defined. Gestures will not work without a menu.")
}
return panGestureRecognizer
}
}
// Deprecations, to be removed at a future date.
extension SideMenuManager {
@available(*, deprecated, renamed: "default.menuPushStyle", message: "SideMenuManager class methods deprecated.")
open static var menuPushStyle: MenuPushStyle {
get {
return `default`.menuPushStyle
}
set {
`default`.menuPushStyle = newValue
}
}
@available(*, deprecated, renamed: "default.menuPresentMode", message: "SideMenuManager class methods deprecated.")
open static var menuPresentMode: MenuPresentMode {
get {
return `default`.menuPresentMode
}
set {
`default`.menuPresentMode = newValue
}
}
@available(*, deprecated, renamed: "default.menuAllowPushOfSameClassTwice", message: "SideMenuManager class methods deprecated.")
open static var menuAllowPushOfSameClassTwice: Bool {
get {
return `default`.menuAllowPushOfSameClassTwice
}
set {
`default`.menuAllowPushOfSameClassTwice = newValue
}
}
@available(*, deprecated, renamed: "default.menuWidth", message: "SideMenuManager class methods deprecated.")
open static var menuWidth: CGFloat {
get {
return `default`.menuWidth
}
set {
`default`.menuWidth = newValue
}
}
@available(*, deprecated, renamed: "default.menuAnimationPresentDuration", message: "SideMenuManager class methods deprecated.")
open static var menuAnimationPresentDuration: Double {
get {
return `default`.menuAnimationPresentDuration
}
set {
`default`.menuAnimationPresentDuration = newValue
}
}
@available(*, deprecated, renamed: "default.menuAnimationDismissDuration", message: "SideMenuManager class methods deprecated.")
open static var menuAnimationDismissDuration: Double {
get {
return `default`.menuAnimationDismissDuration
}
set {
`default`.menuAnimationDismissDuration = newValue
}
}
@available(*, deprecated, renamed: "default.menuAnimationCompleteGestureDuration", message: "SideMenuManager class methods deprecated.")
open static var menuAnimationCompleteGestureDuration: Double {
get {
return `default`.menuAnimationCompleteGestureDuration
}
set {
`default`.menuAnimationCompleteGestureDuration = newValue
}
}
@available(*, deprecated, renamed: "default.menuAnimationFadeStrength", message: "SideMenuManager class methods deprecated.")
open static var menuAnimationFadeStrength: CGFloat {
get {
return `default`.menuAnimationFadeStrength
}
set {
`default`.menuAnimationFadeStrength = newValue
}
}
@available(*, deprecated, renamed: "default.menuAnimationTransformScaleFactor", message: "SideMenuManager class methods deprecated.")
open static var menuAnimationTransformScaleFactor: CGFloat {
get {
return `default`.menuAnimationTransformScaleFactor
}
set {
`default`.menuAnimationTransformScaleFactor = newValue
}
}
@available(*, deprecated, renamed: "default.menuAnimationBackgroundColor", message: "SideMenuManager class methods deprecated.")
open static var menuAnimationBackgroundColor: UIColor? {
get {
return `default`.menuAnimationBackgroundColor
}
set {
`default`.menuAnimationBackgroundColor = newValue
}
}
@available(*, deprecated, renamed: "default.menuShadowOpacity", message: "SideMenuManager class methods deprecated.")
open static var menuShadowOpacity: Float {
get {
return `default`.menuShadowOpacity
}
set {
`default`.menuShadowOpacity = newValue
}
}
@available(*, deprecated, renamed: "default.menuShadowColor", message: "SideMenuManager class methods deprecated.")
open static var menuShadowColor: UIColor {
get {
return `default`.menuShadowColor
}
set {
`default`.menuShadowColor = newValue
}
}
@available(*, deprecated, renamed: "default.menuShadowRadius", message: "SideMenuManager class methods deprecated.")
open static var menuShadowRadius: CGFloat {
get {
return `default`.menuShadowRadius
}
set {
`default`.menuShadowRadius = newValue
}
}
@available(*, deprecated, renamed: "default.menuPresentingViewControllerUserInteractionEnabled", message: "SideMenuManager class methods deprecated.")
open static var menuPresentingViewControllerUserInteractionEnabled: Bool {
get {
return `default`.menuPresentingViewControllerUserInteractionEnabled
}
set {
`default`.menuPresentingViewControllerUserInteractionEnabled = newValue
}
}
@available(*, deprecated, renamed: "default.menuParallaxStrength", message: "SideMenuManager class methods deprecated.")
open static var menuParallaxStrength: Int {
get {
return `default`.menuParallaxStrength
}
set {
`default`.menuParallaxStrength = newValue
}
}
@available(*, deprecated, renamed: "default.menuFadeStatusBar", message: "SideMenuManager class methods deprecated.")
open static var menuFadeStatusBar: Bool {
get {
return `default`.menuFadeStatusBar
}
set {
`default`.menuFadeStatusBar = newValue
}
}
@available(*, deprecated, renamed: "default.menuAnimationOptions", message: "SideMenuManager class methods deprecated.")
open static var menuAnimationOptions: UIViewAnimationOptions {
get {
return `default`.menuAnimationOptions
}
set {
`default`.menuAnimationOptions = newValue
}
}
@available(*, deprecated, renamed: "default.menuAnimationUsingSpringWithDamping", message: "SideMenuManager class methods deprecated.")
open static var menuAnimationUsingSpringWithDamping: CGFloat {
get {
return `default`.menuAnimationUsingSpringWithDamping
}
set {
`default`.menuAnimationUsingSpringWithDamping = newValue
}
}
@available(*, deprecated, renamed: "default.menuAnimationInitialSpringVelocity", message: "SideMenuManager class methods deprecated.")
open static var menuAnimationInitialSpringVelocity: CGFloat {
get {
return `default`.menuAnimationInitialSpringVelocity
}
set {
`default`.menuAnimationInitialSpringVelocity = newValue
}
}
@available(*, deprecated, renamed: "default.menuDismissOnPush", message: "SideMenuManager class methods deprecated.")
open static var menuDismissOnPush: Bool {
get {
return `default`.menuDismissOnPush
}
set {
`default`.menuDismissOnPush = newValue
}
}
/// -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
}
}
}
/// -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
}
}
}
/// -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
}
}
}
@available(*, deprecated, renamed: "default.menuBlurEffectStyle", message: "SideMenuManager class methods deprecated.")
open static var menuBlurEffectStyle: UIBlurEffectStyle? {
get {
return `default`.menuBlurEffectStyle
}
set {
`default`.menuBlurEffectStyle = newValue
}
}
@available(*, deprecated, renamed: "default.menuLeftNavigationController", message: "SideMenuManager class methods deprecated.")
open static var menuLeftNavigationController: UISideMenuNavigationController? {
get {
return `default`.menuLeftNavigationController
}
set {
`default`.menuLeftNavigationController = newValue
}
}
@available(*, deprecated, renamed: "default.menuRightNavigationController", message: "SideMenuManager class methods deprecated.")
open static var menuRightNavigationController: UISideMenuNavigationController? {
get {
return `default`.menuRightNavigationController
}
set {
`default`.menuRightNavigationController = newValue
}
}
@available(*, deprecated, renamed: "default.menuLeftSwipeToDismissGesture", message: "SideMenuManager class methods deprecated.")
open static weak var menuLeftSwipeToDismissGesture: UIPanGestureRecognizer? {
get {
return `default`.menuLeftSwipeToDismissGesture
}
set {
`default`.menuLeftSwipeToDismissGesture = newValue
}
}
@available(*, deprecated, renamed: "default.menuRightSwipeToDismissGesture", message: "SideMenuManager class methods deprecated.")
open static weak var menuRightSwipeToDismissGesture: UIPanGestureRecognizer? {
get {
return `default`.menuRightSwipeToDismissGesture
}
set {
`default`.menuRightSwipeToDismissGesture = newValue
}
}
@available(*, deprecated, renamed: "default.menuEnableSwipeGestures", message: "SideMenuManager class methods deprecated.")
open static var menuEnableSwipeGestures: Bool {
get {
return `default`.menuEnableSwipeGestures
}
set {
`default`.menuEnableSwipeGestures = newValue
}
}
@available(*, deprecated, renamed: "default.menuAddScreenEdgePanGesturesToPresent", message: "SideMenuManager class methods deprecated.")
@discardableResult open class func menuAddScreenEdgePanGesturesToPresent(toView: UIView, forMenu:UIRectEdge? = nil) -> [UIScreenEdgePanGestureRecognizer] {
return `default`.menuAddScreenEdgePanGesturesToPresent(toView: toView, forMenu: forMenu)
}
@available(*, deprecated, renamed: "default.menuAddPanGestureToPresent", message: "SideMenuManager class methods deprecated.")
@discardableResult open class func menuAddPanGestureToPresent(toView: UIView) -> UIPanGestureRecognizer {
return `default`.menuAddPanGestureToPresent(toView: toView)
}
}
+386 -263
View File
@@ -8,428 +8,559 @@
import UIKit
open class SideMenuTransition: UIPercentDrivenInteractiveTransition, UIViewControllerAnimatedTransitioning, UIViewControllerTransitioningDelegate {
open class SideMenuTransition: UIPercentDrivenInteractiveTransition {
fileprivate var presenting = false
fileprivate var interactive = false
fileprivate static weak var originalSuperview: UIView?
fileprivate static var switchMenus = false
internal static let singleton = SideMenuTransition()
internal static var presentDirection: UIRectEdge = .left;
internal static weak var tapView: UIView?
internal static weak var statusBarView: UIView?
// prevent instantiation
fileprivate override init() {}
fileprivate class var viewControllerForPresentedMenu: UIViewController? {
fileprivate weak var originalSuperview: UIView?
fileprivate weak var activeGesture: UIGestureRecognizer?
fileprivate var switchMenus = false {
didSet {
if switchMenus {
cancel()
}
}
}
fileprivate var menuWidth: CGFloat {
get {
return SideMenuManager.menuLeftNavigationController?.presentingViewController != nil ? SideMenuManager.menuLeftNavigationController?.presentingViewController : SideMenuManager.menuRightNavigationController?.presentingViewController
let overriddenWidth = menuViewController?.menuWidth ?? 0
if overriddenWidth > CGFloat.ulpOfOne {
return overriddenWidth
}
return sideMenuManager.menuWidth
}
}
internal weak var sideMenuManager: SideMenuManager!
internal weak var mainViewController: UIViewController?
internal weak var menuViewController: UISideMenuNavigationController? {
get {
return presentDirection == .left ? sideMenuManager.menuLeftNavigationController : sideMenuManager.menuRightNavigationController
}
}
internal var presentDirection: UIRectEdge = .left
internal weak var tapView: UIView? {
didSet {
guard let tapView = tapView else {
return
}
tapView.autoresizingMask = [.flexibleHeight, .flexibleWidth]
let exitPanGesture = UIPanGestureRecognizer()
exitPanGesture.addTarget(self, action:#selector(SideMenuTransition.handleHideMenuPan(_:)))
let exitTapGesture = UITapGestureRecognizer()
exitTapGesture.addTarget(self, action: #selector(SideMenuTransition.handleHideMenuTap(_:)))
tapView.addGestureRecognizer(exitPanGesture)
tapView.addGestureRecognizer(exitTapGesture)
}
}
internal weak var statusBarView: UIView? {
didSet {
guard let statusBarView = statusBarView else {
return
}
statusBarView.backgroundColor = sideMenuManager.menuAnimationBackgroundColor ?? UIColor.black
statusBarView.isUserInteractionEnabled = false
}
}
fileprivate class var visibleViewController: UIViewController? {
required public init(sideMenuManager: SideMenuManager) {
super.init()
NotificationCenter.default.addObserver(self, selector:#selector(handleNotification), name: NSNotification.Name.UIApplicationDidEnterBackground, object: nil)
NotificationCenter.default.addObserver(self, selector:#selector(handleNotification), name: NSNotification.Name.UIApplicationWillChangeStatusBarFrame, object: nil)
self.sideMenuManager = sideMenuManager
}
deinit {
NotificationCenter.default.removeObserver(self)
}
fileprivate static var visibleViewController: UIViewController? {
get {
return getVisibleViewControllerFromViewController(UIApplication.shared.keyWindow?.rootViewController)
return getVisibleViewController(forViewController: UIApplication.shared.keyWindow?.rootViewController)
}
}
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)
fileprivate class func getVisibleViewController(forViewController: UIViewController?) -> UIViewController? {
if let navigationController = forViewController as? UINavigationController {
return getVisibleViewController(forViewController: navigationController.visibleViewController)
}
if let tabBarController = forViewController as? UITabBarController {
return getVisibleViewController(forViewController: tabBarController.selectedViewController)
}
if let splitViewController = forViewController as? UISplitViewController {
return getVisibleViewController(forViewController: splitViewController.viewControllers.last)
}
if let presentedViewController = forViewController?.presentedViewController {
return getVisibleViewController(forViewController: presentedViewController)
}
return viewController
return forViewController
}
internal class func handlePresentMenuLeftScreenEdge(_ edge: UIScreenEdgePanGestureRecognizer) {
SideMenuTransition.presentDirection = .left
@objc internal func handlePresentMenuLeftScreenEdge(_ edge: UIScreenEdgePanGestureRecognizer) {
presentDirection = .left
handlePresentMenuPan(edge)
}
internal class func handlePresentMenuRightScreenEdge(_ edge: UIScreenEdgePanGestureRecognizer) {
SideMenuTransition.presentDirection = .right
@objc internal func handlePresentMenuRightScreenEdge(_ edge: UIScreenEdgePanGestureRecognizer) {
presentDirection = .right
handlePresentMenuPan(edge)
}
internal class func handlePresentMenuPan(_ pan: UIPanGestureRecognizer) {
guard SideMenuManager.menuEnableSwipeGestures else {
@objc internal func handlePresentMenuPan(_ pan: UIPanGestureRecognizer) {
if activeGesture == nil {
activeGesture = pan
} else if pan != activeGesture {
pan.isEnabled = false
pan.isEnabled = true
return
} else if pan.state != .began && pan.state != .changed {
activeGesture = nil
}
// how much distance have we panned in reference to the parent view?
guard let view = viewControllerForPresentedMenu != nil ? viewControllerForPresentedMenu?.view : pan.view else {
guard let view = mainViewController?.view ?? pan.view else {
return
}
let transform = view.transform
view.transform = CGAffineTransform.identity
view.transform = .identity
let translation = pan.translation(in: pan.view!)
view.transform = transform
// do some math to translate this to a percentage based value
if !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 = SideMenuTransition.presentDirection == .left ? SideMenuManager.menuLeftNavigationController : SideMenuManager.menuRightNavigationController,
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 distance = translation.x / SideMenuManager.menuWidth
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
singleton.cancel()
} 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
singleton.cancel()
} else {
singleton.update(min(distance * direction, 1))
update(min(distance * direction, 1))
}
default:
singleton.interactive = false
view.transform = CGAffineTransform.identity
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(FLT_EPSILON) {
singleton.update(0.9999)
if ProcessInfo().operatingSystemVersion.majorVersion == 8 && percentComplete > 1 - CGFloat.ulpOfOne {
update(0.9999)
}
singleton.finish()
finish()
} else {
singleton.cancel()
cancel()
}
}
}
internal class func handleHideMenuPan(_ pan: UIPanGestureRecognizer) {
if !SideMenuManager.menuEnableSwipeGestures {
@objc internal func handleHideMenuPan(_ pan: UIPanGestureRecognizer) {
if activeGesture == nil {
activeGesture = pan
} else if pan != activeGesture {
pan.isEnabled = false
pan.isEnabled = true
return
}
let translation = pan.translation(in: pan.view!)
let direction:CGFloat = SideMenuTransition.presentDirection == .left ? -1 : 1
let distance = translation.x / SideMenuManager.menuWidth * direction
let direction:CGFloat = presentDirection == .left ? -1 : 1
let distance = translation.x / menuWidth * direction
switch (pan.state) {
case .began:
singleton.interactive = true
viewControllerForPresentedMenu?.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(FLT_EPSILON) {
singleton.update(0.9999)
if ProcessInfo().operatingSystemVersion.majorVersion == 8 && percentComplete > 1 - CGFloat.ulpOfOne {
update(0.9999)
}
singleton.finish()
finish()
activeGesture = nil
} else {
singleton.cancel()
cancel()
activeGesture = nil
}
}
}
internal class func handleHideMenuTap(_ tap: UITapGestureRecognizer) {
viewControllerForPresentedMenu?.dismiss(animated: true, completion: nil)
@objc internal func handleHideMenuTap(_ tap: UITapGestureRecognizer) {
menuViewController?.dismiss(animated: true, completion: nil)
}
internal class func hideMenuStart() {
NotificationCenter.default.removeObserver(SideMenuTransition.singleton)
guard let mainViewController = SideMenuTransition.viewControllerForPresentedMenu,
let menuView = SideMenuTransition.presentDirection == .left ? SideMenuManager.menuLeftNavigationController?.view : SideMenuManager.menuRightNavigationController?.view else {return}
@discardableResult internal func hideMenuStart() -> SideMenuTransition {
let menuView = menuViewController?.view
let mainView = mainViewController?.view
menuView.transform = CGAffineTransform.identity
mainViewController.view.transform = CGAffineTransform.identity
mainViewController.view.alpha = 1
SideMenuTransition.tapView?.frame = CGRect(x: 0, y: 0, width: mainViewController.view.frame.width, height: mainViewController.view.frame.height)
menuView.frame.origin.y = 0
menuView.frame.size.width = SideMenuManager.menuWidth
menuView.frame.size.height = mainViewController.view.frame.height
SideMenuTransition.statusBarView?.frame = UIApplication.shared.statusBarFrame
SideMenuTransition.statusBarView?.alpha = 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 = mainView?.frame.height ?? 0 // in case status bar height changed
var statusBarFrame = UIApplication.shared.statusBarFrame
let statusBarOffset = SideMenuManager.appScreenRect.size.height - (mainView?.frame.maxY ?? 0)
// For in-call status bar, height is normally 40, which overlaps view. Instead, calculate height difference
// of view and set height to fill in remaining space.
if statusBarOffset >= CGFloat.ulpOfOne {
statusBarFrame.size.height = statusBarOffset
}
statusBarView?.frame = statusBarFrame
statusBarView?.alpha = 0
switch SideMenuManager.menuPresentMode {
switch sideMenuManager.menuPresentMode {
case .viewSlideOut:
menuView.alpha = 1 - SideMenuManager.menuAnimationFadeStrength
menuView.frame.origin.x = SideMenuTransition.presentDirection == .left ? 0 : mainViewController.view.frame.width - SideMenuManager.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 ?? 0) - menuWidth
menuView?.transform = CGAffineTransform(scaleX: sideMenuManager.menuAnimationTransformScaleFactor, y: sideMenuManager.menuAnimationTransformScaleFactor)
case .viewSlideInOut:
menuView.alpha = 1
menuView.frame.origin.x = SideMenuTransition.presentDirection == .left ? -menuView.frame.width : mainViewController.view.frame.width
mainViewController.view.frame.origin.x = 0
menuView?.alpha = 1
menuView?.frame.origin.x = presentDirection == .left ? -menuView!.frame.width : mainView!.frame.width
case .menuSlideIn:
menuView.alpha = 1
menuView.frame.origin.x = SideMenuTransition.presentDirection == .left ? -menuView.frame.width : mainViewController.view.frame.width
menuView?.alpha = 1
menuView?.frame.origin.x = presentDirection == .left ? -menuView!.frame.width : mainView!.frame.width
case .menuDissolveIn:
menuView.alpha = 0
menuView.frame.origin.x = SideMenuTransition.presentDirection == .left ? 0 : mainViewController.view.frame.width - SideMenuManager.menuWidth
mainViewController.view.frame.origin.x = 0
menuView?.alpha = 0
menuView?.frame.origin.x = presentDirection == .left ? 0 : mainView!.frame.width - menuWidth
}
return self
}
internal class func hideMenuComplete() {
guard let mainViewController = SideMenuTransition.viewControllerForPresentedMenu,
let menuView = SideMenuTransition.presentDirection == .left ? SideMenuManager.menuLeftNavigationController?.view : SideMenuManager.menuRightNavigationController?.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
}
originalSuperview?.addSubview(mainViewController.view)
}
internal class func presentMenuStart(forSize size: CGSize = SideMenuManager.appScreenRect.size) {
guard let menuView = SideMenuTransition.presentDirection == .left ? SideMenuManager.menuLeftNavigationController?.view : SideMenuManager.menuRightNavigationController?.view,
let mainViewController = SideMenuTransition.viewControllerForPresentedMenu else {
return
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)
}
menuView.transform = CGAffineTransform.identity
mainViewController.view.transform = CGAffineTransform.identity
menuView.frame.size.width = SideMenuManager.menuWidth
menuView.frame.size.height = size.height
menuView.frame.origin.x = SideMenuTransition.presentDirection == .left ? 0 : size.width - SideMenuManager.menuWidth
SideMenuTransition.statusBarView?.frame = UIApplication.shared.statusBarFrame
SideMenuTransition.statusBarView?.alpha = 1
originalSuperview = nil
mainViewController = nil
switch SideMenuManager.menuPresentMode {
return self
}
@discardableResult internal func presentMenuStart() -> SideMenuTransition {
let menuView = menuViewController?.view
let mainView = mainViewController?.view
menuView?.alpha = 1
menuView?.transform = .identity
menuView?.frame.size.width = menuWidth
let size = SideMenuManager.appScreenRect.size
menuView?.frame.origin.x = presentDirection == .left ? 0 : size.width - menuWidth
mainView?.transform = .identity
mainView?.frame.size.width = size.width
let statusBarOffset = size.height - (menuView?.bounds.height ?? 0)
mainView?.bounds.size.height = size.height - max(statusBarOffset, 0)
mainView?.frame.origin.y = 0
var statusBarFrame = UIApplication.shared.statusBarFrame
// For in-call status bar, height is normally 40, which overlaps view. Instead, calculate height difference
// of view and set height to fill in remaining space.
if statusBarOffset >= CGFloat.ulpOfOne {
statusBarFrame.size.height = statusBarOffset
}
tapView?.transform = .identity
tapView?.bounds = mainView!.bounds
statusBarView?.frame = statusBarFrame
statusBarView?.alpha = 1
switch sideMenuManager.menuPresentMode {
case .viewSlideOut:
menuView.alpha = 1
let direction:CGFloat = SideMenuTransition.presentDirection == .left ? 1 : -1
mainViewController.view.frame.origin.x = direction * (menuView.frame.width)
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)
case .viewSlideInOut:
menuView.alpha = 1
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 = CGRect(x: direction * (menuView.frame.width), y: 0, width: size.width, height: size.height)
mainViewController.view.transform = CGAffineTransform(scaleX: SideMenuManager.menuAnimationTransformScaleFactor, y: SideMenuManager.menuAnimationTransformScaleFactor)
mainViewController.view.alpha = 1 - SideMenuManager.menuAnimationFadeStrength
case .viewSlideOut, .viewSlideInOut:
mainView?.layer.shadowColor = sideMenuManager.menuShadowColor.cgColor
mainView?.layer.shadowRadius = sideMenuManager.menuShadowRadius
mainView?.layer.shadowOpacity = sideMenuManager.menuShadowOpacity
mainView?.layer.shadowOffset = CGSize(width: 0, height: 0)
let direction:CGFloat = presentDirection == .left ? 1 : -1
mainView?.frame.origin.x = direction * (menuView!.frame.width)
case .menuSlideIn, .menuDissolveIn:
menuView.alpha = 1
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)
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 = CGRect(x: 0, y: 0, width: size.width, height: size.height)
mainViewController.view.transform = CGAffineTransform(scaleX: SideMenuManager.menuAnimationTransformScaleFactor, y: SideMenuManager.menuAnimationTransformScaleFactor)
mainViewController.view.alpha = 1 - SideMenuManager.menuAnimationFadeStrength
mainView?.frame.origin.x = 0
}
if sideMenuManager.menuPresentMode != .viewSlideOut {
mainView?.transform = CGAffineTransform(scaleX: sideMenuManager.menuAnimationTransformScaleFactor, y: sideMenuManager.menuAnimationTransformScaleFactor)
if sideMenuManager.menuAnimationTransformScaleFactor > 1 {
tapView?.transform = mainView!.transform
}
mainView?.alpha = 1 - sideMenuManager.menuAnimationFadeStrength
}
return self
}
internal class func presentMenuComplete() {
NotificationCenter.default.addObserver(SideMenuTransition.singleton, selector:#selector(SideMenuTransition.applicationDidEnterBackgroundNotification), name: NSNotification.Name.UIApplicationDidEnterBackground, object: nil)
guard let mainViewController = SideMenuTransition.viewControllerForPresentedMenu 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
}
// MARK: UIViewControllerAnimatedTransitioning protocol methods
@objc internal func handleNotification(notification: NSNotification) {
guard menuViewController?.presentedViewController == nil &&
menuViewController?.presentingViewController != nil else {
return
}
if let originalSuperview = originalSuperview, let mainViewController = mainViewController {
originalSuperview.addSubview(mainViewController.view)
}
if notification.name == NSNotification.Name.UIApplicationDidEnterBackground {
hideMenuStart().hideMenuComplete()
menuViewController?.dismiss(animated: false, completion: nil)
return
}
UIView.animate(withDuration: sideMenuManager.menuAnimationDismissDuration,
delay: 0,
usingSpringWithDamping: sideMenuManager.menuAnimationUsingSpringWithDamping,
initialSpringVelocity: sideMenuManager.menuAnimationInitialSpringVelocity,
options: sideMenuManager.menuAnimationOptions,
animations: {
self.hideMenuStart()
}) { (finished) -> Void in
self.hideMenuComplete()
self.menuViewController?.dismiss(animated: false, completion: nil)
}
}
}
extension SideMenuTransition: UIViewControllerAnimatedTransitioning {
// animate a change from one viewcontroller to another
open func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
// get reference to our fromView, toView and the container view that we should perform the transition in
let container = transitionContext.containerView
if let menuBackgroundColor = SideMenuManager.menuAnimationBackgroundColor {
// prevent any other menu gestures from firing
container.isUserInteractionEnabled = false
if let menuBackgroundColor = sideMenuManager.menuAnimationBackgroundColor {
container.backgroundColor = menuBackgroundColor
}
// create a tuple of our screens
let screens : (from:UIViewController, to:UIViewController) = (transitionContext.viewController(forKey: UITransitionContextViewControllerKey.from)!, transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to)!)
let fromViewController = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.from)!
let toViewController = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to)!
// assign references to our menu view controller and the 'bottom' view controller from the tuple
// remember that our menuViewController will alternate between the from and to view controller depending if we're presenting or dismissing
let menuViewController = (!presenting ? screens.from : screens.to)
let topViewController = !presenting ? screens.to : screens.from
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 {
var tapView: UIView?
if !SideMenuManager.menuPresentingViewControllerUserInteractionEnabled {
tapView = UIView()
tapView!.autoresizingMask = [.flexibleHeight, .flexibleWidth]
let exitPanGesture = UIPanGestureRecognizer()
exitPanGesture.addTarget(SideMenuTransition.self, action:#selector(SideMenuTransition.handleHideMenuPan(_:)))
let exitTapGesture = UITapGestureRecognizer()
exitTapGesture.addTarget(SideMenuTransition.self, action: #selector(SideMenuTransition.handleHideMenuTap(_:)))
tapView!.addGestureRecognizer(exitPanGesture)
tapView!.addGestureRecognizer(exitTapGesture)
SideMenuTransition.tapView = tapView
}
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!)
if let tapView = tapView {
topView?.addSubview(tapView)
}
container.addSubview(menuView)
container.addSubview(topView)
case .menuSlideIn, .menuDissolveIn:
container.addSubview(topView!)
if let tapView = tapView {
container.addSubview(tapView)
}
container.addSubview(menuView!)
container.addSubview(topView)
container.addSubview(menuView)
}
if sideMenuManager.menuFadeStatusBar {
let statusBarView = UIView()
self.statusBarView = statusBarView
container.addSubview(statusBarView)
}
if SideMenuManager.menuFadeStatusBar {
let blackBar = UIView()
if let menuShrinkBackgroundColor = SideMenuManager.menuAnimationBackgroundColor {
blackBar.backgroundColor = menuShrinkBackgroundColor
hideMenuStart()
}
let animate = {
if self.presenting {
self.presentMenuStart()
} else {
self.hideMenuStart()
}
}
let complete = {
container.isUserInteractionEnabled = true
// tell our transitionContext object that we've finished animating
if transitionContext.transitionWasCancelled {
let viewControllerForPresentedMenu = self.mainViewController
if self.presenting {
self.hideMenuComplete()
} else {
blackBar.backgroundColor = UIColor.black
self.presentMenuComplete()
}
blackBar.isUserInteractionEnabled = false
container.addSubview(blackBar)
SideMenuTransition.statusBarView = blackBar
transitionContext.completeTransition(false)
if self.switchMenus {
self.switchMenus = false
viewControllerForPresentedMenu?.present(self.menuViewController!, animated: true, completion: nil)
}
return
}
SideMenuTransition.hideMenuStart() // offstage for interactive
if self.presenting {
self.presentMenuComplete()
transitionContext.completeTransition(true)
switch self.sideMenuManager.menuPresentMode {
case .viewSlideOut, .viewSlideInOut:
container.addSubview(topView)
case .menuSlideIn, .menuDissolveIn:
container.insertSubview(topView, at: 0)
}
if !self.sideMenuManager.menuPresentingViewControllerUserInteractionEnabled {
let tapView = UIView()
container.insertSubview(tapView, aboveSubview: topView)
tapView.bounds = container.bounds
tapView.center = topView.center
if self.sideMenuManager.menuAnimationTransformScaleFactor > 1 {
tapView.transform = topView.transform
}
self.tapView = tapView
}
if let statusBarView = self.statusBarView {
container.bringSubview(toFront: statusBarView)
}
return
}
self.hideMenuComplete()
transitionContext.completeTransition(true)
menuView.removeFromSuperview()
}
// perform the animation!
let duration = transitionDuration(using: transitionContext)
let options: UIViewAnimationOptions = interactive ? .curveLinear : UIViewAnimationOptions()
UIView.animate(withDuration: duration, delay: 0, options: options, animations: { () -> Void in
if self.presenting {
SideMenuTransition.presentMenuStart() // onstage items: slide in
} else {
SideMenuTransition.hideMenuStart()
}
menuView?.isUserInteractionEnabled = false
if interactive {
UIView.animate(withDuration: duration,
delay: duration, // HACK: If zero, the animation briefly flashes in iOS 11. UIViewPropertyAnimators (iOS 10+) may resolve this.
options: .curveLinear,
animations: {
animate()
}, completion: { (finished) in
complete()
})
} else {
UIView.animate(withDuration: duration,
delay: 0,
usingSpringWithDamping: sideMenuManager.menuAnimationUsingSpringWithDamping,
initialSpringVelocity: sideMenuManager.menuAnimationInitialSpringVelocity,
options: sideMenuManager.menuAnimationOptions,
animations: {
animate()
}) { (finished) -> Void in
// tell our transitionContext object that we've finished animating
if transitionContext.transitionWasCancelled {
let viewControllerForPresentedMenu = SideMenuTransition.viewControllerForPresentedMenu
if self.presenting {
SideMenuTransition.hideMenuComplete()
} else {
SideMenuTransition.presentMenuComplete()
}
menuView?.isUserInteractionEnabled = true
transitionContext.completeTransition(false)
if SideMenuTransition.switchMenus {
SideMenuTransition.switchMenus = false
viewControllerForPresentedMenu?.present(SideMenuTransition.presentDirection == .left ? SideMenuManager.menuLeftNavigationController! : SideMenuManager.menuRightNavigationController!, animated: true, completion: nil)
}
return
}
if self.presenting {
SideMenuTransition.presentMenuComplete()
menuView?.isUserInteractionEnabled = true
transitionContext.completeTransition(true)
switch SideMenuManager.menuPresentMode {
case .viewSlideOut, .viewSlideInOut:
container.addSubview(topView!)
case .menuSlideIn, .menuDissolveIn:
container.insertSubview(topView!, at: 0)
}
if let statusBarView = SideMenuTransition.statusBarView {
container.bringSubview(toFront: statusBarView)
}
return
}
SideMenuTransition.hideMenuComplete()
transitionContext.completeTransition(true)
menuView?.removeFromSuperview()
complete()
}
}
}
// return how many seconds the transiton animation will take
open func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
return presenting ? SideMenuManager.menuAnimationPresentDuration : SideMenuManager.menuAnimationDismissDuration
if interactive {
return sideMenuManager.menuAnimationCompleteGestureDuration
}
return presenting ? sideMenuManager.menuAnimationPresentDuration : sideMenuManager.menuAnimationDismissDuration
}
// MARK: UIViewControllerTransitioningDelegate protocol methods
open override func update(_ percentComplete: CGFloat) {
guard !switchMenus else {
return
}
super.update(percentComplete)
}
}
extension SideMenuTransition: UIViewControllerTransitioningDelegate {
// return the animator when presenting a viewcontroller
// rememeber that an animator (or animation controller) is any object that aheres to the UIViewControllerAnimatedTransitioning protocol
open func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
self.presenting = true
SideMenuTransition.presentDirection = presented == SideMenuManager.menuLeftNavigationController ? .left : .right
presentDirection = presented == sideMenuManager.menuLeftNavigationController ? .left : .right
return self
}
@@ -442,19 +573,11 @@ open class SideMenuTransition: UIPercentDrivenInteractiveTransition, UIViewContr
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
}
internal func applicationDidEnterBackgroundNotification() {
if let menuViewController: UINavigationController = SideMenuTransition.presentDirection == .left ? SideMenuManager.menuLeftNavigationController : SideMenuManager.menuRightNavigationController {
SideMenuTransition.hideMenuStart()
SideMenuTransition.hideMenuComplete()
menuViewController.dismiss(animated: false, completion: nil)
}
return interactive ? self : nil
}
}
+257 -74
View File
@@ -7,161 +7,344 @@
import UIKit
@objc public protocol UISideMenuNavigationControllerDelegate: class {
func sideMenuWillAppear(menu: UISideMenuNavigationController, animated: Bool)
func sideMenuDidAppear(menu: UISideMenuNavigationController, animated: Bool)
func sideMenuWillDisappear(menu: UISideMenuNavigationController, animated: Bool)
func sideMenuDidDisappear(menu: UISideMenuNavigationController, animated: Bool)
}
// This makes adherance to the protocol optional:
extension UIViewController {
func sideMenuWillAppear(menu: UISideMenuNavigationController, animated: Bool) {}
func sideMenuDidAppear(menu: UISideMenuNavigationController, animated: Bool) {}
func sideMenuWillDisappear(menu: UISideMenuNavigationController, animated: Bool) {}
func sideMenuDidDisappear(menu: UISideMenuNavigationController, animated: Bool) {}
}
open class UISideMenuNavigationController: UINavigationController {
fileprivate weak var foundDelegate: UISideMenuNavigationControllerDelegate?
fileprivate weak var activeDelegate: UISideMenuNavigationControllerDelegate? {
get {
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 {
get {
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.
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 {
get {
return self.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
}
}
}
fileprivate func didSetSide() {
if leftSide {
SideMenuManager.menuLeftNavigationController = self
} else {
SideMenuManager.menuRightNavigationController = self
}
open override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// Dismiss keyboard to prevent weird keyboard animations from occurring during transition
presentingViewController?.view.endEditing(true)
foundDelegate = nil
activeDelegate?.sideMenuWillAppear(menu: self, animated: animated)
}
override open func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
// we had presented a view before, so lets dismiss ourselves as already acted upon
// 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)
}
}
}
// 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)
// we're presenting a view controller from the menu, so we need to hide the menu so it isn't g when the presented view is dismissed.
if !isBeingDismissed {
view.isHidden = true
SideMenuTransition.hideMenuStart()
// 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,
let indexPaths = tableView.indexPathsForSelectedRows,
tableViewController.clearsSelectionOnViewWillAppear else {
return
}
for indexPath in indexPaths {
tableView.deselectRow(at: indexPath, animated: false)
}
}
override open func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)
// don't bother resizing if the view isn't visible
if view.isHidden {
// Don't bother resizing if the view isn't visible
guard !view.isHidden else {
return
}
SideMenuTransition.statusBarView?.isHidden = true
coordinator.animate(alongsideTransition: { (context) -> Void in
SideMenuTransition.presentMenuStart(forSize: size)
}) { (context) -> Void in
SideMenuTransition.statusBarView?.isHidden = false
NotificationCenter.default.removeObserver(self.transition, name: NSNotification.Name.UIApplicationWillChangeStatusBarFrame, object: nil)
coordinator.animate(alongsideTransition: { (context) in
self.transition.presentMenuStart()
}) { (context) in
NotificationCenter.default.addObserver(self.transition, selector:#selector(SideMenuTransition.handleNotification), name: NSNotification.Name.UIApplicationWillChangeStatusBarFrame, object: nil)
}
}
override open func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if let menuViewController: UINavigationController = SideMenuTransition.presentDirection == .left ? SideMenuManager.menuLeftNavigationController : SideMenuManager.menuRightNavigationController,
let presentingViewController = menuViewController.presentingViewController as? UINavigationController {
presentingViewController.prepare(for: segue, sender: sender)
}
}
override open func shouldPerformSegue(withIdentifier identifier: String, sender: Any?) -> Bool {
if let menuViewController: UINavigationController = SideMenuTransition.presentDirection == .left ? SideMenuManager.menuLeftNavigationController : SideMenuManager.menuRightNavigationController,
let presentingViewController = menuViewController.presentingViewController as? UINavigationController {
return presentingViewController.shouldPerformSegue(withIdentifier: identifier, sender: sender)
}
return super.shouldPerformSegue(withIdentifier: identifier, sender: sender)
}
override open func pushViewController(_ viewController: UIViewController, animated: Bool) {
guard viewControllers.count > 0 && !SideMenuManager.menuAllowSubmenus 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: true)
super.pushViewController(viewController, animated: animated)
return
}
let splitViewController = presentingViewController as? UISplitViewController
let tabBarController = presentingViewController as? UITabBarController
let potentialNavigationController = (splitViewController?.viewControllers.first ?? tabBarController?.selectedViewController) ?? presentingViewController
guard let navigationController = potentialNavigationController as? UINavigationController else {
print("SideMenu Warning: attempt to push a View Controller from \(String(describing: potentialNavigationController.self)) where its navigationController == nil. It must be embedded in a Navigation Controller for this to work.")
return
}
guard let presentingViewController = presentingViewController as? UINavigationController else {
print("SideMenu Warning: attempt to push a View Controller from \(self.presentingViewController.self) where its navigationController == nil. It must be embedded in a Navigation Controller for this to work.")
return
}
let activeDelegate = self.activeDelegate
foundDelegate = nil
// to avoid overlapping dismiss & pop/push calls, create a transaction block where the menu
// 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)
self.visibleViewController?.viewWillAppear(false) // Hack: force selection to get cleared on UITableViewControllers when reappearing using custom transitions
})
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)
})
UIView.animate(withDuration: SideMenuManager.menuAnimationDismissDuration, animations: { () -> Void in
SideMenuTransition.hideMenuStart()
})
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 SideMenuManager.menuAllowPopIfPossible {
for subViewController in presentingViewController.viewControllers {
if let lastViewController = navigationController.viewControllers.last, !sideMenuManager.menuAllowPushOfSameClassTwice && type(of: lastViewController) == type(of: viewController) {
CATransaction.commit()
return
}
switch sideMenuManager.menuPushStyle {
case .subMenu, .defaultBehavior: break // .subMenu handled earlier, .defaultBehavior falls through to end
case .popWhenPossible:
for subViewController in navigationController.viewControllers.reversed() {
if type(of: subViewController) == type(of: viewController) {
presentingViewController.popToViewController(subViewController, animated: animated)
navigationController.popToViewController(subViewController, animated: animated)
CATransaction.commit()
return
}
}
}
if let lastViewController = presentingViewController.viewControllers.last, SideMenuManager.menuAllowPushOfSameClassTwice {
if type(of: lastViewController) == type(of: viewController) {
case .preserve, .preserveAndHideBackButton:
var viewControllers = navigationController.viewControllers
let filtered = viewControllers.filter { preservedViewController in type(of: preservedViewController) == type(of: viewController) }
if let preservedViewController = filtered.last {
viewControllers = viewControllers.filter { subViewController in subViewController !== preservedViewController }
if sideMenuManager.menuPushStyle == .preserveAndHideBackButton {
preservedViewController.navigationItem.hidesBackButton = true
}
viewControllers.append(preservedViewController)
navigationController.setViewControllers(viewControllers, animated: animated)
CATransaction.commit()
return
}
if sideMenuManager.menuPushStyle == .preserveAndHideBackButton {
viewController.navigationItem.hidesBackButton = true
}
case .replace:
viewController.navigationItem.hidesBackButton = true
navigationController.setViewControllers([viewController], animated: animated)
CATransaction.commit()
return
}
presentingViewController.pushViewController(viewController, animated: animated)
navigationController.pushViewController(viewController, animated: animated)
CATransaction.commit()
}
}
+15 -5
View File
@@ -13,6 +13,16 @@ open class UITableViewVibrantCell: UITableViewCell {
fileprivate var vibrancyView:UIVisualEffectView = UIVisualEffectView()
fileprivate var vibrancySelectedBackgroundView:UIVisualEffectView = UIVisualEffectView()
fileprivate var defaultSelectedBackgroundView:UIView?
open var blurEffectStyle: UIBlurEffectStyle? {
didSet {
updateBlur()
}
}
// For registering with UITableView without subclassing otherwise dequeuing instance of the cell causes an exception
public override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
}
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
@@ -27,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, !UIAccessibilityIsReduceTransparencyEnabled() {
let blurEffect = UIBlurEffect(style: blurEffectStyle)
vibrancyView.effect = UIVibrancyEffect(blurEffect: blurEffect)
if selectedBackgroundView != nil && selectedBackgroundView != vibrancySelectedBackgroundView {
+28 -3
View File
@@ -328,7 +328,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0700;
LastUpgradeCheck = 0900;
};
buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */;
compatibilityVersion = "Xcode 3.2";
@@ -405,20 +405,30 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = 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_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGNING_REQUIRED = NO;
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"POD_CONFIGURATION_DEBUG=1",
@@ -466,7 +476,7 @@
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
@@ -482,19 +492,29 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = 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_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGNING_REQUIRED = NO;
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"POD_CONFIGURATION_RELEASE=1",
"$(inherited)",
@@ -508,6 +528,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/;
STRIP_INSTALLED_PRODUCT = NO;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SYMROOT = "${SRCROOT}/../build";
VALIDATE_PRODUCT = YES;
};
@@ -517,6 +538,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 3324698B7EF536D06111969551D7A984 /* Pods-Example.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
@@ -553,6 +575,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = E84078875951590B4A5503E807E1791E /* Pods-Example.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
@@ -588,6 +611,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 7CAC7C8AA53EBC987714BAC240E7DE89 /* Pods-Example-ExampleTests.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
@@ -624,6 +648,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 36CF7D6DA1B99FEA132A604D0BF8FB58 /* Pods-Example-ExampleTests.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
@@ -680,7 +705,7 @@
PRODUCT_NAME = SideMenu;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
+188 -78
View File
@@ -5,26 +5,33 @@
[![Platform](https://img.shields.io/cocoapods/p/SideMenu.svg?style=flat)](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!
> Hi, I'm Jon Kent and I am an iOS designer, developer, and mobile strategist. I love coffee and play the drums.
> * [**Hire me**](mailto:yo@massappeal.co?subject=Let's%20build%20something%20amazing) to help you make cool stuff. *Note: If you're having a problem with SideMenu, please open an [issue](https://github.com/jonkykong/SideMenu/issues/new) and do not email me.*
> * Check out my [website](http://massappeal.co) to see some of my other projects.
> * Building and maintaining this free library takes time. Help keep me awake and buy me a coffee ☕️ via [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=contact%40jonkent%2eme&lc=US&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted).
## Overview
SideMenu is a simple and versatile side menu control written in Swift.
* **It can be implemented in storyboard without a single line of [code](#code-less-storyboard-implementation).**
* Four standard animation styles to choose from (even parallax if you want to get weird).
* Highly customizable without needing to write tons of custom code.
* Supports continuous swiping between side menus on boths sides in a single gesture.
* Global menu configuration. Set-up once and be done for all screens.
* Menus can be presented and dismissed the same as any other View Controller since this control uses custom transitions.
- [x] **It can be implemented in storyboard without a single line of [code](#code-less-storyboard-implementation).**
- [x] Four standard animation styles to choose from (there's even a parallax effect if you want to get weird).
- [x] Highly customizable without needing to write tons of custom code.
- [x] Supports continuous swiping between side menus on boths sides in a single gesture.
- [x] Global menu configuration. Set-up once and be done for all screens.
- [x] Menus can be presented and dismissed the same as any other view controller since this control uses [custom transitions](https://developer.apple.com/library/content/featuredarticles/ViewControllerPGforiPhoneOS/CustomizingtheTransitionAnimations.html).
- [x] Animations use your view controllers, not snapshots.
- [x] Properly handles screen rotation and in-call status bar height changes.
Check out the example project to see it in action!
![](etc/SlideOut.gif)
![](etc/SlideIn.gif)
![](etc/Dissolve.gif)
![](etc/InOut.gif)
### Preview Samples
| Slide Out | Slide In | Dissolve | Slide In + Out |
| --- | --- | --- | --- |
| ![](etc/SlideOut.gif) | ![](etc/SlideIn.gif) | ![](etc/Dissolve.gif) | ![](etc/InOut.gif) |
## Requirements
* iOS 8 or higher
- [x] iOS 8 or higher.
## Installation
### CocoaPods
@@ -44,8 +51,8 @@ use_frameworks!
pod 'SideMenu'
# For Swift 2.3, use:
# pod 'SideMenu', '~> 1.2.1'
# For Swift 3 (no longer maintained), use:
# pod 'SideMenu', '~> 2.3.4'
```
Then, run the following command:
@@ -68,18 +75,18 @@ $ brew install carthage
To integrate SideMenu into your Xcode project using Carthage, specify it in your `Cartfile`:
```ogdl
github "jonkykong/SideMenu"
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**. 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.
1. Create a Navigation Controller for a side menu. Set the `Custom Class` of the Navigation Controller to be `UISideMenuNavigationController` in the **Identity Inspector**. Set the `Module` to `SideMenu` (ignore this step if you've manually added SideMenu to your project). Create a Root View Controller for the Navigation Controller (shown as a UITableViewController below). Set up any Triggered Segues you want in that view controller.
![](etc/Screenshot1.png)
2. Set the `Left Side` property of the `UISideMenuNavigationController` to On if you want it to appear from the left side of the screen, or Off/Default if you want it to appear from the right side.
![](etc/Screenshot2.png)
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.
3. Add a UIButton or UIBarButton to a view controller that you want to display the menu from. Set that button's Triggered Segues action to modally present the Navigation Controller from step 1.
![](etc/Screenshot3.png)
That's it. *Note: you can only enable gestures in code.*
@@ -89,31 +96,51 @@ First:
import SideMenu
```
In your View Controller's `viewDidLoad` event, do something like this:
In your view controller's `viewDidLoad` event, do something like this (**IMPORTANT: If you're seeing a black menu when you use gestures, read this section carefully!**):
``` swift
// Define the menus
let menuLeftNavigationController = UISideMenuNavigationController()
menuLeftNavigationController.leftSide = true
// UISideMenuNavigationController is a subclass of UINavigationController, so do any additional configuration of it here like setting its viewControllers.
SideMenuManager.menuLeftNavigationController = menuLeftNavigationController
let menuLeftNavigationController = 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 menuLeftNavigationController = storyboard!.instantiateViewController(withIdentifier: "LeftMenuNavigationController") as! UISideMenuNavigationController
SideMenuManager.default.menuLeftNavigationController = menuLeftNavigationController
let menuRightNavigationController = UISideMenuNavigationController()
// UISideMenuNavigationController is a subclass of UINavigationController, so do any additional configuration of it here like setting its viewControllers.
SideMenuManager.menuRightNavigationController = menuRightNavigationController
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.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)
// Note that these continue to work on the Navigation Controller independent of the view controller it displays!
SideMenuManager.default.menuAddPanGestureToPresent(toView: self.navigationController!.navigationBar)
SideMenuManager.default.menuAddScreenEdgePanGesturesToPresent(toView: self.navigationController!.view)
```
Then from a button, do something like this:
``` swift
presentViewController(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)
```
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 (defaults are shown below for reference):
``` swift
/**
The push style of the menu.
There are six modes in MenuPushStyle:
- defaultBehavior: The view controller is pushed onto the stack.
- popWhenPossible: If a view controller already in the stack is of the same class as the pushed view controller, the stack is instead popped back to the existing view controller. This behavior can help users from getting lost in a deep navigation stack.
- preserve: If a view controller already in the stack is of the same class as the pushed view controller, the existing view controller is pushed to the end of the stack. This behavior is similar to a UITabBarController.
- preserveAndHideBackButton: Same as .preserve and back buttons are automatically hidden.
- replace: Any existing view controllers are released from the stack and replaced with the pushed view controller. Back buttons are automatically hidden. This behavior is ideal if view controllers require a lot of memory or their state doesn't need to be preserved..
- subMenu: Unlike all other behaviors that push using the menu's presentingViewController, this behavior pushes view controllers within the menu. Use this behavior if you want to display a sub menu.
*/
open var menuPushStyle: MenuPushStyle = .defaultBehavior
/**
The presentation mode of the menu.
@@ -123,108 +150,191 @@ 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
/// Pops to any view controller already in the navigation stack instead of the view controller being pushed if they share the same class. Defaults to false.
open static var menuAllowPopIfPossible = false
/**
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.
open static var menuWidth: CGFloat = max(round(min((appScreenRect.width), (appScreenRect.height)) * 0.75), 240)
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 present or dismiss the menu. Default is true.
open static var menuEnableSwipeGestures: Bool = true
/// Enable or disable gestures that would swipe to dismiss the menu. Default is 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
/// When true, pushViewController called within the menu it will push the new view controller inside of the menu. Otherwise, it is pushed on the menu's presentingViewController. Default is false.
open static var menuAllowSubmenus: Bool = false
/// The animation options when a menu is displayed. Ignored when displayed with a gesture.
open var menuAnimationOptions: UIViewAnimationOptions = .curveEaseInOut
/// The animation spring damping when a menu is displayed. Ignored when displayed with a gesture.
open var menuAnimationUsingSpringWithDamping: CGFloat = 1
/// The animation initial spring velocity when a menu is displayed. Ignored when displayed with a gesture.
open var menuAnimationInitialSpringVelocity: CGFloat = 1
/**
Automatically dismisses the menu when another view is pushed from it.
Note: to prevent the menu from dismissing when presenting, set modalPresentationStyle = .overFullScreen
of the view controller being presented in storyboard or during its initalization.
*/
open var menuDismissOnPush = true
/// 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!
## About Me
My name is Jon Kent and I'm a freelance iOS designer, developer, and mobile strategist. I love coffee and play the drums. **Hire me!**
🌎 Web: [http://jonkent.me](http://jonkent.me)
✉️ Email: [contact@jonkent.me](mailto:contact@jonkent.me) **IMPORTANT: Before emailing me, please read [this](https://github.com/jonkykong/SideMenu/issues/58).**
## License
SideMenu is available under the MIT license. See the LICENSE file for more info.
+1 -1
View File
@@ -8,7 +8,7 @@
Pod::Spec.new do |s|
s.name = "SideMenu"
s.version = "2.0.6"
s.version = "3.1.4"
s.summary = "Simple side menu control for iOS in Swift inspired by Facebook. Right and Left sides. No coding required."
# This description is used to generate tags and improve search results.
+69 -13
View File
@@ -9,16 +9,21 @@
/* 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 */; };
8461A2D41E145A08001DA4F8 /* SideMenuTransition.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8461A2D01E145A08001DA4F8 /* SideMenuTransition.swift */; };
8461A2D51E145A08001DA4F8 /* UISideMenuNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8461A2D11E145A08001DA4F8 /* UISideMenuNavigationController.swift */; };
8461A2D61E145A08001DA4F8 /* UITableViewVibrantCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8461A2D21E145A08001DA4F8 /* UITableViewVibrantCell.swift */; };
84B489B51DD469B000D6CB43 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 84B489B21DD469B000D6CB43 /* LICENSE */; };
84B489B71DD469B000D6CB43 /* README.md in Sources */ = {isa = PBXBuildFile; fileRef = 84B489B41DD469B000D6CB43 /* README.md */; };
84B489B71DD469B000D6CB43 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 84B489B41DD469B000D6CB43 /* README.md */; };
84B489BA1DD469DA00D6CB43 /* SideMenu.podspec in Resources */ = {isa = PBXBuildFile; fileRef = 84B489B91DD469DA00D6CB43 /* SideMenu.podspec */; };
ACD6DAED90DE36FEA68CDF38 /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 47896ABC5C8830D88945A8D3 /* Pods_Example.framework */; };
/* End PBXBuildFile section */
@@ -38,6 +43,7 @@
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>"; };
47896ABC5C8830D88945A8D3 /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
52C8DD7BE43A8987854CA726 /* Pods_Example_ExampleTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example_ExampleTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
65FF1B3D1DE321D8007B0845 /* SideMenu.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SideMenu.h; path = SideMenu/SideMenu.h; sourceTree = "<group>"; };
7B48A0D31DCB2487002990A1 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
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>"; };
@@ -47,10 +53,14 @@
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; };
8461A2CF1E145A08001DA4F8 /* SideMenuManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SideMenuManager.swift; path = Pod/Classes/SideMenuManager.swift; sourceTree = "<group>"; };
8461A2D01E145A08001DA4F8 /* SideMenuTransition.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SideMenuTransition.swift; path = Pod/Classes/SideMenuTransition.swift; sourceTree = "<group>"; };
8461A2D11E145A08001DA4F8 /* UISideMenuNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UISideMenuNavigationController.swift; path = Pod/Classes/UISideMenuNavigationController.swift; sourceTree = "<group>"; };
8461A2D21E145A08001DA4F8 /* UITableViewVibrantCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UITableViewVibrantCell.swift; path = Pod/Classes/UITableViewVibrantCell.swift; sourceTree = "<group>"; };
84B489B21DD469B000D6CB43 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
84B489B41DD469B000D6CB43 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
84B489B91DD469DA00D6CB43 /* SideMenu.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SideMenu.podspec; sourceTree = "<group>"; };
@@ -89,15 +99,35 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
65FF1B391DE31DA3007B0845 /* SupportingFiles */ = {
isa = PBXGroup;
children = (
);
name = SupportingFiles;
sourceTree = "<group>";
};
65FF1B3F1DE33097007B0845 /* Source */ = {
isa = PBXGroup;
children = (
8461A2CF1E145A08001DA4F8 /* SideMenuManager.swift */,
8461A2D01E145A08001DA4F8 /* SideMenuTransition.swift */,
8461A2D11E145A08001DA4F8 /* UISideMenuNavigationController.swift */,
8461A2D21E145A08001DA4F8 /* UITableViewVibrantCell.swift */,
65FF1B3D1DE321D8007B0845 /* SideMenu.h */,
);
name = Source;
sourceTree = "<group>";
};
7B48A0D41DCB2487002990A1 /* Example */ = {
isa = PBXGroup;
children = (
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 */,
);
@@ -116,6 +146,7 @@
7B9DC8FA1DC6E8C1000D4007 = {
isa = PBXGroup;
children = (
65FF1B3F1DE33097007B0845 /* Source */,
84B489B81DD469B900D6CB43 /* Podspec Metadata */,
7B48A0D41DCB2487002990A1 /* Example */,
7B48A0E91DCB2487002990A1 /* ExampleTests */,
@@ -175,6 +206,7 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
65FF1B3E1DE321D8007B0845 /* SideMenu.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -247,20 +279,23 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0800;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0900;
ORGANIZATIONNAME = jonkykong;
TargetAttributes = {
7B48A0D21DCB2487002990A1 = {
CreatedOnToolsVersion = 8.0;
LastSwiftMigration = 0900;
ProvisioningStyle = Automatic;
};
7B48A0E51DCB2487002990A1 = {
CreatedOnToolsVersion = 8.0;
LastSwiftMigration = 0900;
ProvisioningStyle = Automatic;
TestTargetID = 7B48A0D21DCB2487002990A1;
};
7B9DC9031DC6E8C1000D4007 = {
CreatedOnToolsVersion = 8.0;
LastSwiftMigration = 0900;
ProvisioningStyle = Automatic;
};
};
@@ -309,6 +344,7 @@
files = (
84B489BA1DD469DA00D6CB43 /* SideMenu.podspec in Resources */,
84B489B51DD469B000D6CB43 /* LICENSE in Resources */,
84B489B71DD469B000D6CB43 /* README.md in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -412,7 +448,7 @@
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 */,
@@ -431,7 +467,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
84B489B71DD469B000D6CB43 /* README.md in Sources */,
8461A2D51E145A08001DA4F8 /* UISideMenuNavigationController.swift in Sources */,
8461A2D41E145A08001DA4F8 /* SideMenuTransition.swift in Sources */,
8461A2D61E145A08001DA4F8 /* UITableViewVibrantCell.swift in Sources */,
8461A2D31E145A08001DA4F8 /* SideMenuManager.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -456,7 +495,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.jonkykong.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
@@ -470,7 +509,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.jonkykong.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Release;
};
@@ -484,7 +523,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.jonkykong.ExampleTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example";
};
name = Debug;
@@ -499,7 +538,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.jonkykong.ExampleTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example";
};
name = Release;
@@ -513,7 +552,9 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
@@ -521,7 +562,11 @@
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_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
@@ -567,7 +612,9 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
@@ -575,7 +622,11 @@
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_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
@@ -608,6 +659,7 @@
7B9DC90D1DC6E8C1000D4007 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
@@ -617,16 +669,19 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MODULEMAP_FILE = "$(SRCROOT)/SideMenu/module.modulemap";
PRODUCT_BUNDLE_IDENTIFIER = com.jonkykong.SideMenu;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
};
name = Debug;
};
7B9DC90E1DC6E8C1000D4007 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
@@ -636,10 +691,11 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MODULEMAP_FILE = "$(SRCROOT)/SideMenu/module.modulemap";
PRODUCT_BUNDLE_IDENTIFIER = com.jonkykong.SideMenu;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Release;
};
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7B9DC9031DC6E8C1000D4007"
BuildableName = "SideMenu.framework"
BlueprintName = "SideMenu"
ReferencedContainer = "container:SideMenu.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7B9DC9031DC6E8C1000D4007"
BuildableName = "SideMenu.framework"
BlueprintName = "SideMenu"
ReferencedContainer = "container:SideMenu.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7B9DC9031DC6E8C1000D4007"
BuildableName = "SideMenu.framework"
BlueprintName = "SideMenu"
ReferencedContainer = "container:SideMenu.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
+6
View File
@@ -0,0 +1,6 @@
framework module SideMenu {
umbrella header "SideMenu.h"
export *
module * { export * }
}