Compare commits

...

17 Commits

Author SHA1 Message Date
jonkykong 3234d78609 Update README and podspec. 2016-10-20 14:30:01 -07:00
jonkykong 8b5af286e9 Fix to test non-optionals when type comparing. 2016-10-20 14:26:18 -07:00
jonkykong 603a7a1832 Update README for Github. 2016-10-19 23:47:59 -07:00
jonkykong 36dc4cf421 Updating README for Cocoapods. 2016-10-19 23:44:42 -07:00
jonkykong 3f335caebf Updated podspec. 2016-10-19 23:26:41 -07:00
jonkykong 0de56fefeb Removing behavior to present a menu if pushing isn't available as more true to expected behavior. 2016-10-19 23:26:07 -07:00
jonkykong 697dce16db Opening up SideMenuTransition for subclassing if desired. 2016-10-19 23:24:19 -07:00
Jon Kent 68fd7d8f24 Update README.md 2016-09-30 10:59:21 -07:00
Jon Kent b5b5ed24b0 Update README.md 2016-09-28 16:19:24 -07:00
jonkykong be9192a273 Reversing README for Github. 2016-09-28 16:17:00 -07:00
jonkykong da1c07080b Updated README and pod spec for Cocoapods. 2016-09-28 16:10:31 -07:00
jonkykong 227207438c Merge branch 'pr/77' into 2.0.3
* pr/77:
  Comments cleanup.
  adding capability to add submenus
2016-09-28 16:02:01 -07:00
jonkykong 0d6d833a23 Comments cleanup. 2016-09-28 16:01:35 -07:00
Jon Kent 74d1142537 Update README.md 2016-09-26 14:32:02 -07:00
Jon Kent 7ff74b862c Update README.md 2016-09-26 14:10:12 -07:00
Oliver Gepp 0b70228ddf adding capability to add submenus 2016-09-23 19:25:54 +02:00
jonkykong 316608d5d5 Reverse README for GitHub. 2016-09-20 13:51:57 -07:00
5 changed files with 33 additions and 29 deletions
+3
View File
@@ -93,6 +93,9 @@ open class SideMenuManager : NSObject {
/// Draws the `menuAnimationBackgroundColor` behind the status bar. Default is true.
open static 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
/// -Warning: Deprecated. Use `menuAnimationTransformScaleFactor` instead.
@available(*, deprecated, renamed: "menuAnimationTransformScaleFactor")
open static var menuAnimationShrinkStrength: CGFloat {
+12 -12
View File
@@ -8,7 +8,7 @@
import UIKit
internal class SideMenuTransition: UIPercentDrivenInteractiveTransition, UIViewControllerAnimatedTransitioning, UIViewControllerTransitioningDelegate {
open class SideMenuTransition: UIPercentDrivenInteractiveTransition, UIViewControllerAnimatedTransitioning, UIViewControllerTransitioningDelegate {
fileprivate var presenting = false
fileprivate var interactive = false
@@ -47,17 +47,17 @@ internal class SideMenuTransition: UIPercentDrivenInteractiveTransition, UIViewC
return viewController
}
class func handlePresentMenuLeftScreenEdge(_ edge: UIScreenEdgePanGestureRecognizer) {
internal class func handlePresentMenuLeftScreenEdge(_ edge: UIScreenEdgePanGestureRecognizer) {
SideMenuTransition.presentDirection = .left
handlePresentMenuPan(edge)
}
class func handlePresentMenuRightScreenEdge(_ edge: UIScreenEdgePanGestureRecognizer) {
internal class func handlePresentMenuRightScreenEdge(_ edge: UIScreenEdgePanGestureRecognizer) {
SideMenuTransition.presentDirection = .right
handlePresentMenuPan(edge)
}
class func handlePresentMenuPan(_ pan: UIPanGestureRecognizer) {
internal class func handlePresentMenuPan(_ pan: UIPanGestureRecognizer) {
if !SideMenuManager.menuEnableSwipeGestures {
return
}
@@ -124,7 +124,7 @@ internal class SideMenuTransition: UIPercentDrivenInteractiveTransition, UIViewC
}
}
class func handleHideMenuPan(_ pan: UIPanGestureRecognizer) {
internal class func handleHideMenuPan(_ pan: UIPanGestureRecognizer) {
if !SideMenuManager.menuEnableSwipeGestures {
return
}
@@ -155,7 +155,7 @@ internal class SideMenuTransition: UIPercentDrivenInteractiveTransition, UIViewC
}
}
class func handleHideMenuTap(_ tap: UITapGestureRecognizer) {
internal class func handleHideMenuTap(_ tap: UITapGestureRecognizer) {
viewControllerForPresentedMenu?.dismiss(animated: true, completion: nil)
}
@@ -296,7 +296,7 @@ internal class SideMenuTransition: UIPercentDrivenInteractiveTransition, UIViewC
// MARK: UIViewControllerAnimatedTransitioning protocol methods
// animate a change from one viewcontroller to another
internal func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
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
@@ -419,7 +419,7 @@ internal class SideMenuTransition: UIPercentDrivenInteractiveTransition, UIViewC
}
// return how many seconds the transiton animation will take
internal func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
open func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
return presenting ? SideMenuManager.menuAnimationPresentDuration : SideMenuManager.menuAnimationDismissDuration
}
@@ -427,25 +427,25 @@ internal class SideMenuTransition: UIPercentDrivenInteractiveTransition, UIViewC
// return the animator when presenting a viewcontroller
// rememeber that an animator (or animation controller) is any object that aheres to the UIViewControllerAnimatedTransitioning protocol
internal func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
open func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
self.presenting = true
SideMenuTransition.presentDirection = presented == SideMenuManager.menuLeftNavigationController ? .left : .right
return self
}
// return the animator used when dismissing from a viewcontroller
internal func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
open func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
presenting = false
return self
}
internal func interactionControllerForPresentation(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? {
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
}
internal func interactionControllerForDismissal(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? {
open func interactionControllerForDismissal(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? {
return interactive ? SideMenuTransition.singleton : nil
}
@@ -119,7 +119,7 @@ open class UISideMenuNavigationController: UINavigationController {
}
override open func pushViewController(_ viewController: UIViewController, animated: Bool) {
guard viewControllers.count > 0 else {
guard viewControllers.count > 0 && !SideMenuManager.menuAllowSubmenus 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)
@@ -127,8 +127,7 @@ open class UISideMenuNavigationController: UINavigationController {
}
guard let presentingViewController = presentingViewController as? UINavigationController else {
present(viewController, animated: animated, completion: nil)
print("SideMenu Warning: cannot push a ViewController from a ViewController without a NavigationController. It will be presented it instead.")
print("SideMenu Warning: attempt to push a ViewController from a ViewController without a NavigationController. Your ViewController must be embedded in a NavigationController for this to work.")
return
}
@@ -153,8 +152,8 @@ open class UISideMenuNavigationController: UINavigationController {
}
}
}
if !SideMenuManager.menuAllowPushOfSameClassTwice {
if type(of: presentingViewController.viewControllers.last) == type(of: viewController) {
if let lastViewController = presentingViewController.viewControllers.last, SideMenuManager.menuAllowPushOfSameClassTwice {
if type(of: lastViewController) == type(of: viewController) {
CATransaction.commit()
return
}
+6 -4
View File
@@ -1,9 +1,9 @@
# SideMenu
# SideMenu
[![Version](https://img.shields.io/cocoapods/v/SideMenu.svg?style=flat)](http://cocoapods.org/pods/SideMenu)
[![License](https://img.shields.io/cocoapods/l/SideMenu.svg?style=flat)](http://cocoapods.org/pods/SideMenu)
[![Platform](https://img.shields.io/cocoapods/p/SideMenu.svg?style=flat)](http://cocoapods.org/pods/SideMenu)
**If you like SideMenu, give it a ★ at the top right of its [GitHub](https://github.com/jonkykong/SideMenu) page.**
### If you like SideMenu, give it a ★ at the top right of its [GitHub](https://github.com/jonkykong/SideMenu) page.
## Overview
@@ -26,7 +26,6 @@ Check out the example project to see it in action!
* iOS 8 or higher
## Installation
### CocoaPods
[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:
@@ -158,6 +157,9 @@ open static var menuParallaxStrength: Int = 0
/// Draws the `menuAnimationBackgroundColor` behind the status bar. Default is true.
open static 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
```
## Known Issues
@@ -171,7 +173,7 @@ My name is Jon Kent and I'm a freelance iOS designer, developer, and mobile stra
🌎 Web: [http://jonkent.me](http://jonkent.me)
✉️ Email: [contact@jonkent.me](mailto:contact@jonkent.me) **_IMPORTANT: If you're having a problem implementing SideMenu, please open an [issue](https://github.com/jonkykong/SideMenu/issues) instead of emailing me. Thanks!_**
✉️ Email: [contact@jonkent.me](mailto:contact@jonkent.me) **IMPORTANT: Before emailing me, please read [this](https://github.com/jonkykong/SideMenu/issues/58).**
## License
+8 -8
View File
@@ -8,7 +8,7 @@
Pod::Spec.new do |s|
s.name = "SideMenu"
s.version = "2.0.2"
s.version = "2.0.5"
s.summary = "Simple side menu control for iOS in Swift inspired by Facebook. Right and Left sides. No coding required."
# This description is used to generate tags and improve search results.
@@ -16,24 +16,24 @@ Pod::Spec.new do |s|
# * Try to keep it short, snappy and to the point.
# * Write the description between the DESC delimiters below.
# * Finally, don't worry about the indent, CocoaPods strips it!
s.description = <<-DESC
SideMenu is a simple and versatile side menu control. It's highly customizable, but can also be implemented in storyboard without a single line of code. The are three standard animation styles to choose from along with several other options for further customization if desired. Just type SideMenuManager.menu... and code completion will show you everything you can customize.
DESC
s.homepage = "https://github.com/jonkykong/SideMenu"
s.screenshots = [ "https://raw.githubusercontent.com/jonkykong/SideMenu/master/etc/SlideOut.gif", "https://raw.githubusercontent.com/jonkykong/SideMenu/master/etc/SlideIn.gif", "https://raw.githubusercontent.com/jonkykong/SideMenu/master/etc/Dissolve.gif", "https://raw.githubusercontent.com/jonkykong/SideMenu/master/etc/InOut.gif" ]
s.license = 'MIT'
s.author = { "jonkykong" => "jonk@jonked.com" }
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { "jonkykong" => "contact@jonkent.me" }
s.source = { :git => "https://github.com/jonkykong/SideMenu.git", :tag => s.version.to_s }
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
s.platform = :ios, '8.0'
s.requires_arc = true
s.ios.deployment_target = '8.0'
s.source_files = 'Pod/Classes/**/*'
# s.resource_bundles = {
# 'SideMenu' => ['Pod/Assets/*.png']
# }
# s.resource_bundles = {
# 'SideMenu' => ['Pod/Assets/*.png']
# }
# s.public_header_files = 'Pod/Classes/**/*.h'
# s.frameworks = 'UIKit', 'MapKit'