All Projects → dogo → Aksidemenu

dogo / Aksidemenu

Licence: mit
Beautiful iOS side menu library with parallax effect. Written in Swift

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Aksidemenu

Sketchkit
A lightweight auto-layout DSL library for iOS & tvOS.
Stars: ✭ 40 (-81.48%)
Mutual labels:  cocoapods, carthage, swift-package-manager, spm
Alamofire
Elegant HTTP Networking in Swift
Stars: ✭ 36,896 (+16981.48%)
Mutual labels:  cocoapods, carthage, swift-package-manager
L10n Swift
Localization of the application with ability to change language "on the fly" and support for plural form in any language.
Stars: ✭ 177 (-18.06%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Natrium
A pre-build (Swift) script to alter your Xcode project at pre-build-time per environment, build configuration and target.
Stars: ✭ 131 (-39.35%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Xmlmapper
A simple way to map XML to Objects written in Swift
Stars: ✭ 90 (-58.33%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Buckets Swift
Swift Collection Data Structures Library
Stars: ✭ 106 (-50.93%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Bettersegmentedcontrol
An easy to use, customizable replacement for UISegmentedControl & UISwitch.
Stars: ✭ 1,782 (+725%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Loadingshimmer
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.
Stars: ✭ 1,180 (+446.3%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Ducttape
📦 KeyPath dynamicMemberLookup based syntax sugar for Swift.
Stars: ✭ 138 (-36.11%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Color
Color utilities for macOS, iOS, tvOS, and watchOS
Stars: ✭ 145 (-32.87%)
Mutual labels:  cocoapods, carthage, spm
Cdmarkdownkit
An extensive Swift framework providing simple and customizable markdown parsing.
Stars: ✭ 158 (-26.85%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Freedom
The Freedom to Open URLs in Third-Party Browsers on iOS with Custom UIActivity Subclasses.
Stars: ✭ 85 (-60.65%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Swiftlinkpreview
It makes a preview from an URL, grabbing all the information such as title, relevant texts and images.
Stars: ✭ 1,216 (+462.96%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Swifterswift
A handy collection of more than 500 native Swift extensions to boost your productivity.
Stars: ✭ 10,706 (+4856.48%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Dikit
Dependency Injection Framework for Swift, inspired by KOIN.
Stars: ✭ 77 (-64.35%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Randomkit
Random data generation in Swift
Stars: ✭ 1,458 (+575%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Shsearchbar
The search bar that doesn't suck.
Stars: ✭ 206 (-4.63%)
Mutual labels:  cocoapods, carthage, spm
Cameramanager
Simple Swift class to provide all the configurations you need to create custom camera view in your app
Stars: ✭ 1,130 (+423.15%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Sheeeeeeeeet
Sheeeeeeeeet is a Swift library for creating menus, custom action sheets, context menus etc.
Stars: ✭ 1,177 (+444.91%)
Mutual labels:  cocoapods, carthage, spm
Coregpx
A library for parsing and creation of GPX location files. Purely Swift.
Stars: ✭ 132 (-38.89%)
Mutual labels:  cocoapods, carthage, swift-package-manager

AKSideMenu

Building Cocoapods Pod License Carthage compatible

AKSideMenu is a double side menu library with parallax effect.

AKSideMenu Screenshot AKSideMenu Screenshot

Example Project

See the contained examples to get a sample of how AKSideMenu can easily be integrated in your project.

Build the examples from the AKSideMenuExamples directory.

Installation

CocoaPods.

To install, add the following line to your Podfile:

pod 'AKSideMenu'

Carthage.

To install, add the following line to your Cartfile:

github "dogo/AKSideMenu" "1.4.5"

Easy to use

Simple implementation

In your AppDelegate, add the code below.

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    self.window = UIWindow.init(frame: UIScreen.main.bounds)

    // Create content and menu controllers
    let navigationController: UINavigationController = UINavigationController.init(rootViewController: FirstViewController.init())
    let leftMenuViewController: LeftMenuViewController = LeftMenuViewController.init()
    let rightMenuViewController: RightMenuViewController = RightMenuViewController.init()

    // Create side menu controller
    let sideMenuViewController: AKSideMenu = AKSideMenu(contentViewController: navigationController, leftMenuViewController: leftMenuViewController, rightMenuViewController: rightMenuViewController)

    // Make it a root controller
    self.window!.rootViewController = sideMenuViewController

    self.window!.backgroundColor = UIColor.white
    self.window?.makeKeyAndVisible()
    return true
}        

Storyboards Example

  1. Create a subclass of AKSideMenu. In this example we call it RootViewController.
  2. In the Storyboard designate the root view's owner as RootViewController.
  3. Add more view controllers to your Storyboard, and give them identifiers "leftMenuViewController", "rightMenuViewController" and "contentViewController". Note that in the new XCode the identifier is called "Storyboard ID" and can be found in the Identity inspector.
  4. Add a method awakeFromNib to RootViewController.swift with the following code:
override public func awakeFromNib() {    
    self.contentViewController = self.storyboard!.instantiateViewControllerWithIdentifier("contentViewController")
    self.leftMenuViewController = self.storyboard!.instantiateViewControllerWithIdentifier("leftMenuViewController")
    self.rightMenuViewController = self.storyboard!.instantiateViewControllerWithIdentifier("rightMenuViewController")
}

Here is an example of a delegate implementation. Please adapt the code to your context.

...
sideMenuViewController.delegate = self
...

// MARK: - <AKSideMenuDelegate>

open func sideMenu(_ sideMenu: AKSideMenu, shouldRecognizeGesture recognizer: UIGestureRecognizer, simultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
    // return true to allow both gesture recognizers to recognize simultaneously. Returns false by default
    return false
}

open func sideMenu(_ sideMenu: AKSideMenu, gestureRecognizer: UIGestureRecognizer, shouldRequireFailureOf otherGestureRecognizer: UIGestureRecognizer) -> Bool {
    // return true or false based on your failure requirements. Returns false by default
    return false
}

open func sideMenu(_ sideMenu: AKSideMenu, gestureRecognizer: UIGestureRecognizer, shouldBeRequiredToFailBy otherGestureRecognizer: UIGestureRecognizer) -> Bool {
    // return true or false based on your failure requirements. Returns false by default
    return false
}

open func sideMenu(_ sideMenu: AKSideMenu, willShowMenuViewController menuViewController: UIViewController) {
    print("willShowMenuViewController")
}

open func sideMenu(_ sideMenu: AKSideMenu, didShowMenuViewController menuViewController: UIViewController) {
    print("didShowMenuViewController")
}

open func sideMenu(_ sideMenu: AKSideMenu, willHideMenuViewController menuViewController: UIViewController) {
    print("willHideMenuViewController")
}

open func sideMenu(_ sideMenu: AKSideMenu, didHideMenuViewController menuViewController: UIViewController) {
    print("didHideMenuViewController")
}

Present the menu view controller:

self.sideMenuViewController!.presentLeftMenuViewController()

or

self.sideMenuViewController!.presentRightMenuViewController()

Switch content view controllers:

self.sideMenuViewController!.setContentViewController(viewController, animated: true)
self.sideMenuViewController!.hideMenuViewController()

Properties

public var animationDuration: TimeInterval

The animation duration. Defaults to 0.35.

public var backgroundImage: UIImage

The content background image. Defaults to white.

public var panGestureEnabled: Bool

Enables panGesture detection. Defaults to True.

public var panFromEdge: Bool

Enables panGesture detection from the edge. Defaults to True.

public var panMinimumOpenThreshold: Float

The minimum pan gesture amount to open the side menu. Defaults to 60.0.

public var interactivePopGestureRecognizerEnabled: Bool

Enables interactive pop gesture recognizer. Defaults to True.

public var scaleContentView: Bool

TODO. Defaults to True.

public var scaleBackgroundImageView: Bool

TODO. Defaults to False.

public var scaleMenuView: Bool

TODO. Defaults to True.

public let contentViewShadowEnabled: Bool

TODO. Defaults to False.

public var contentViewShadowOffset: CGSize

TODO. Defaults to CGSizeZero.

public var contentViewShadowOpacity: Float

TODO. Defaults to 0.4.

public var contentViewShadowRadius: CGFloat

TODO. Defaults to 8.0.

public var contentViewScaleValue: CGFloat

TODO. Defaults to 0.7.

public var contentViewInLandscapeOffsetCenterX: CGFloat

TODO. Defaults to 30.0.

public var contentViewInPortraitOffsetCenterX: CGFloat

TODO. Defaults to 30.0.

public var parallaxMenuMinimumRelativeValue: CGFloat

TODO. Defaults to -15.

public var parallaxMenuMaximumRelativeValue: CGFloat

TODO. Defaults to 15.

public var parallaxContentMinimumRelativeValue: CGFloat

TODO. Defaults to -25.

public var parallaxContentMaximumRelativeValue: CGFloat

TODO. Defaults to 25.

public var menuViewControllerTransformation: CGAffineTransform

TODO. Defaults to nil.

public var parallaxEnabled: Bool

TODO. Defaults to True.

public var bouncesHorizontally: Bool

TODO. Defaults to True.

public var menuPreferredStatusBarStyle: UIStatusBarStyle

Preferred UIStatusBarStyle when the menu is visible. Defaults to UIStatusBarStyle.default.

public var menuPrefersStatusBarHidden: Bool

Sets StatusBar hidden or not when the menu is visible. Defaults to False.

public var backgroundTransformScale: CGFloat

Sets the transform scale amount applied to the background imageview. Defaults to 1.7.

public var panFromEdgeZoneWidth: CGFloat

Sets the width of the pan gesture zone should be recognized. Defaults to 20.0.

public var panGestureLeftEnabled: Bool

Enable or disable left pan gesture recognition. Defaults to True.

public var panGestureRightEnabled: Bool

Enable or disable right pan gesture recognition. Defaults to True.

Collaboration

I tried to build an easy way to use API, while being flexible enough for multiple variations, but I'm sure there are ways of improving and adding more features, so feel free to collaborate with ideas, issues and/or pull requests.

ARC

AKSideMenu needs ARC.

Licence

AKSideMenu is available under the MIT license.

Thanks to the original team

Roman Efimov @romaonthego

https://github.com/romaonthego/RESideMenu

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].