Coder Social home page Coder Social logo

sidemenucontroller's Introduction

SideMenuController

Swift3 Platform Build Status Version Carthage Compatible License

Description

SideMenuController is a custom container view controller written in Swift which will display the main content within a center panel and the secondary content (option menu, navigation menu, etc.) within a side panel when triggered. The side panel can be displayed either on the left or on the right side, under or over the center panel.

SideMenuController SideMenuController
SideMenuController SideMenuController

Contents

  1. Features
  2. Installation
  3. Supported OS & SDK versions
  4. Usage
  5. Caching
  6. Customisation
  7. Implementing custom transitions
  8. Public interface
  9. [Delegation] (#delegation)
  10. License
  11. Contact

## Features

  • Easy to use, fully customisable
  • Left and Right side positioning
  • Over and Under center positioning
  • Automatic orientation change adjustments.
  • Fully customisable transition animations
  • Custom status bar behaviour (see Customisation for details):
SideMenuController SideMenuController
SideMenuController SideMenuController

CocoaPods

CocoaPods is a dependency manager for Cocoa projects.

CocoaPods 0.36 adds supports for Swift and embedded frameworks. You can install it with the following command:

$ gem install cocoapods

To integrate SideMenuController into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'SideMenuController'

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate SideMenuController into your Xcode project using Carthage, specify it in your Cartfile:

github "teodorpatras/SideMenuController"

Run carthage update to build the framework and drag the built SideMenuController.framework into your Xcode project.

Manually

If you prefer not to use either of the aforementioned dependency managers, you can integrate sources in the Source folder into your project manually.

  • Supported build target - iOS 8.0+ (Xcode 7+)

You can get started using SideMenuController in 3 simple steps:

###Step 1 First of all, you should add a menu button image and specify the position of the side panel. Optionally, you can customise other preferences as well. This can be achieved in two ways:

1) If the SideMenuController subclass is the initial view controller in your main storyboard:

Subclass SideMenuController and override init(coder:) where you can change the preferences according to your own style:

class CustomSideMenuController: SideMenuController {

    required init?(coder aDecoder: NSCoder) {
        SideMenuController.preferences.drawing.menuButtonImage = UIImage(named: "menu")
        SideMenuController.preferences.drawing.sidePanelPosition = .overCenterPanelLeft
        SideMenuController.preferences.drawing.sidePanelWidth = 300
        SideMenuController.preferences.drawing.centerPanelShadow = true
        SideMenuController.preferences.animating.statusBarBehaviour = .showUnderlay
        super.init(coder: aDecoder)
    }
}

Next, go to the Storyboard, and change the class of the SideMenuController to the custom subclass you just created.

2) In all other cases:

In AppDelegate.swift, override application:didFinishLaunchingWithOptions::

func func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    // Override point for customization after application launch.

    SideMenuController.preferences.drawing.menuButtonImage = UIImage(named: "menu")
    SideMenuController.preferences.drawing.sidePanelPosition = .overCenterPanelLeft
    SideMenuController.preferences.drawing.sidePanelWidth = 300
    SideMenuController.preferences.drawing.centerPanelShadow = true
    SideMenuController.preferences.animating.statusBarBehaviour = .showUnderlay
}

⚠️_If you do not specify a menu button image, SideMenuController will not add one by default and you will have to manually add one whenever transitioning to a new center view controller._

###Step 2 SideMenuController can be used with storyboard segues, or you can programmatically transition to a new center view controller.

####Using storyboard segues####

SideMenuController defines two custom segues:

  • SideContainmentSegue - which transitions to a new side controller (triggers embedSideController)
  • CenterContainmentSegue - which transitions to a new center controller (triggers embedCenterController)

In the storyboard file, add initially two segues from the SideMenuController scene, one for the center view controller, and another for the side menu view controller. Later on, you can add more CenterContainmentSeuges depending on how many scenes you want to transition to.

Remember to set all the appropriate attributes of each segue in the Attributes Inspector:

| SideContainmentSegue | CenterContainmentSegue | |----------|:-------------:|------:| | Example | Example |

In order to embed the inital view controlles inside the SideMenuController you will have to call performSegue(withIdentifier:sender:). Easiest way is to subclass SideMenuController and override viewDidLoad:

override func viewDidLoad() {
    super.viewDidLoad()
    performSegue(withIdentifier: "embedInitialCenterController", sender: nil)
    performSegue(withIdentifier: "embedSideController", sender: nil)
}

####Programmatically####

You can perform all the above mentioned transitions programmatically, without using segues, by calling one of the two public methods:

public func embed(sideViewController: UIViewController)
public func embed(centerViewController: UViewController)

Important Note: In case you want the center view controller to be of different type than UINavigationController, you'll have to add the menu button to one/all of its children navigation controllers programmatically. SideMenuController defines an extension to UINavigationController in order to make it easy to do that. Just call navigationController.addSideMenuButton(). Before calling that method, make sure the navigation controller is already embedded inside the SideMenuController's child controller hierarchy.

Example with UITabBarController:

// create the view controllers for center containment
let vc1 = UIViewController()
vc1.view.backgroundColor = UIColor.red
vc1.title = "first"
let nc1 = UINavigationController(rootViewController: vc1)
vc1.navigationItem.title = "first"

let vc2 = UIViewController()
vc2.view.backgroundColor = UIColor.yellow
vc2.title = "second"
let nc2 = UINavigationController(rootViewController: vc2)
vc2.navigationItem.title = "second"

let vc3 = UIViewController()
vc3.view.backgroundColor = UIColor.blue
vc3.title = "third"
let nc3 = UINavigationController(rootViewController: vc3)
vc3.navigationItem.title = "third"

let tabBarController = UITabBarController()
tabBarController.viewControllers = [nc1, nc2, nc3]

// create the side controller
let sideController = UITableViewController()

// embed the side and center controllers
sideMenuViewController.embed(sideViewController: sideController)
sideMenuViewController.embed(centerViewController: tabBarController)

// add the menu button to each view controller embedded in the tab bar controller
[nc1, nc2, nc3].forEach({ controller in
  controller.addSideMenuButton()
})

show(sideMenuViewController, sender: nil)

###Step 3 You're almost set now. Last step is to know how to transition to new center view controllers.

Important Note: SideMenuController defines an extension to UIViewController in order to make it more accessible via the computed property public var sideMenuController: SideMenuController?. From any UIViewController instance, you can access the SideMenuController by typing: self.sideMenuController. This will return the SideMenuController if the caller is one of its child view controllers or otherwise nil.

From here onwards, whenever the user selects an option in the side menu controller, you can easily perform the segue like so:

####Using storyboard segues####

override func tableView(_ tableView: UITableView,
                            didSelectRowAt indexPath: IndexPath)  {
	sideMenuController?.performSegue(withIdentifier: segues[indexPath.row], sender: nil)
}

####Programmatically####

override func tableView(_ tableView: UITableView,
                            didSelectRowAt indexPath: IndexPath)  {
	sideMenuController?.embed(centerViewController: someUIViewControllerInstance)
}

SideMenuController offers you the possibility to cache center view controllers instead of always instantiating new ones when changing them.

To transition to a new center view controller and cache it, call embed(centerViewController:, cacheIdentifier:) on the SideMenuController.

To retrieve a cached center view controller based on a cache identifier, call viewController(forCacheIdentifier:) on the SideMenuController.

###Example

In your side view controller (a.k.a the menu controller):

override func tableView(_ tableView: UITableView,
                            didSelectRowAt indexPath: IndexPath)  {

    // retrieve your identifier
    let cacheIdentifier = ...
    // retrieve your view controller
    let viewController = ...

    if let controller = sideMenuController?.viewController(forCacheIdentifier: cacheIdentifier) {
        sideMenuController?.embed(centerViewController: controller)
    } else {
        sideMenuController?.embed(centerViewController: UINavigationController(rootViewController: viewController), cacheIdentifier: cacheIdentifier)
    }
}

For a more detailed example, check the Example project.

In order to customise the SideMenuController appearance and behaviour, you can play with the SideMenuController .Preferences structure. It is split into three sub structures:

  • Drawing - encapsulates custom attributes specifying how SideMenuController will adjust its layout, positioning on screen.
  • Animating - encapsulates custom attributes specifying which animations will be used for different components.
  • Interaction - encapsulates custom attributes specifying how the user is allowed to interract with the side panel

| Drawing attribute | Description | |----------|-------------|------| | menuButtonImage | In case this attribute is set, SideMenuController will add a button on the left or right side of the navigation bar of the center view controller (in case it is a subclass of UINavigationController) in order to trigger the slide animation. If the attribute is missing, or the center view controller is not a subclass of UINavigationController, you'll have to add the menu button by yourself to all the UINavigationControllers that will be embedded. | | sidePanelPosition | Specifies the positioning of the side panel. This attribute can take one of the four values: .underCenterPanelLeft, .underCenterPanelRight, .overCenterPanelLeft, .overCenterPanelRight | | sidePanelWidth | The width of the side panel. | | centerPanelOverlayColor | When the side panel is either .overCenterPanelLeft or .overCenterPanelRight, an overlay will be shown on top of the center panel when the side is revealed. Pass the preferred color of this overlay. | | centerPanelShadow | When the side panel is either .underCenterPanelRight or .underCenterPanelLeft you can opt in or out to draw a side shadow for the center panel. |

| Animating attribute | Description | |----------|-------------|------| | statusBarBehaviour | The animating style of the status bar when the side panel is revealed. This can be:
+ .slideAnimation: the status bar will be hidden using the UIStatusBarAnimation.slide animation
+ .fadeAnimation: the status bar will be hidden using the UIStatusBarAnimation.fade animation
+ .horizontalPan: the status bar will slide along with the center panel horizontally.
+ .showUnderlay: a layer with the same color as the navigation bar will be displayed under the status bar | | reavealDuration | Reveal animation duration. | | hideDuration | Hide animation duration. | | transitionAnimator | TransitionAnimatable subtype which defines how the new center view controller will be animated on screen. |

Interaction attribute Description Discussion
panningEnabled Default value is true When the side panel is positioned under the center panel, the panning is recognized on the center panel. When the side panel is positoned over the center panel, the panning is recognized on the side panel.
swipingEnabled Default value is true There is no swipe gesture recognizer instantiated when the side panel is positioned under the center panel. When the side panel is positioned over the center panel, the swipe is going to recognized on the center panel.
menuButtonAccessibilityIdentifier Accessibility identifier to be set on the menu button.

In order to implement custom transition animations for the center view controller, you have to create a struct that conforms to the TransitionAnimatable protocol and implement: static func performTransition(forView view: UIView, completion: () -> Void)

Example:

public struct FadeAnimator: TransitionAnimatable {

    public static func performTransition(forView view: UIView, completion: @escaping () -> Void) {
        CATransaction.begin()
        CATransaction.setCompletionBlock(completion)
        let fadeAnimation = CABasicAnimation(keyPath: "opacity")
        fadeAnimation.duration = 0.35
        fadeAnimation.fromValue = 0
        fadeAnimation.toValue = 1
        fadeAnimation.fillMode = kCAFillModeForwards
        fadeAnimation.isRemovedOnCompletion = true
        view.layer.add(fadeAnimation, forKey: "fade")
        CATransaction.commit()
    }
}

For more examples, check TransitionAnimator.swift.

##Public methods##

/**
 Toggles the side pannel visible or not.
*/
public func toggle()

/**
 Returns a view controller for the specified cache identifier

 - parameter identifier: cache identifier

 - returns: Cached UIViewController or nil
*/
public func viewController(forCacheIdentifier identifier: String) -> UIViewController?

/**
 Embeds a new side controller

 - parameter sideViewController: controller to be embedded
*/
public func embed(sideViewController controller: UIViewController)

/**
 Embeds a new center controller.

 - parameter centerViewController: controller to be embedded
 - parameter cacheIdentifier: identifier for the view controllers cache
*/
public func embed(centerViewController controller: UIViewController, cacheIdentifier: String? = nil)

##Public properties##

Property Type Description
preferences SideMenuController.Preferences use to customise the SideMenuController preferences
sidePanelVisible Bool use to check at any time if the side panel is visible or not
centerViewController UIViewController use to access the currently embedded center view controller.
sideViewController UIViewController use to access the currently embedded side view controller.
delegate SideMenuControllerDelegate use to set the delegate to be notified about certain events.

SideMenuController defines a delegate protocol which you can use if you want to be announced when the side panel has been revealed or hidden:

public protocol SideMenuControllerDelegate: class {
    func sideMenuControllerDidHide(_ sideMenuController: SideMenuController)
    func sideMenuControllerDidReveal(_ sideMenuController: SideMenuController)
}

In order to receive the aforementioned callbacks, simply assign the delegate property to the SideMenuController instance.

SideMenuController is developed by Teodor Patraş and is released under the MIT license. See the LICENSE file for details. Logo graphic created with Logo Maker.

You can follow or drop me a line on my Twitter account. If you find any issues on the project, you can open a ticket. Pull requests are also welcome.

sidemenucontroller's People

Contributors

aradchenko avatar jeffgukang avatar jobinsjohn avatar justinlee avatar teodorpatras avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sidemenucontroller's Issues

Rotation

Thank you for a straight forward and clean solution. Can you direct me what to do for rotation recalculation of views.

Thanks.

Presenting a view controller from the center view controller

Hello,

We have a setup where we have a UITableViewController (within a UINavigationController) as the centre view.

When a cell is tapped, we want to segue to another view controller like a normal Push segue.

I have tried two different setups for this. One in the storyboard, standard hooking up a segue and calling it. Secondly, I tried instantiating the view controller programmatically and calling self.navigationController.presentViewControlller... But these do not display as expected. The first case always shows the controller with a modal/show detail style (not sure which). The presentViewController route replaces the stack entirely, strange.

Do you know how to push a controller with a normal push segue from a centre view controller?

Thanks

embed doesn't me work

Hi, I'm trying SideMenuController but not working properly embedded mode.

When I select an item from the side menu, the new view controller is loaded full screen. Not load embedded in the center. Therefore, the side menu button disappears, but if I slide from left to right, menu appears.

This is my code in MenuController:

func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
if let index = previousIndex {
tableView.deselectRowAtIndexPath(index, animated: true)
}
let listadoCentrosController:ListadoCentrosController = self.storyboard?.instantiateViewControllerWithIdentifier("centrosVC") as! ListadoCentrosController
sideMenuController?.embed(centerViewController: listadoCentrosController, cacheIdentifier: nil)
previousIndex = indexPath

captura de pantalla 2016-09-08 a las 10 59 14

captura de pantalla 2016-09-08 a las 10 59 21

captura de pantalla 2016-09-08 a las 10 59 32

Someone knows I'm doing wrong?

Thank you very much

Programmatic creation

Is it possible to use this programmatically?

I'm try to do so like so

`
let planDetailsVC = PlanDetailsViewController()
planDetailsVC.plan = plan
planDetailsVC.show_members = show_members

    let membersVC = PlanMembersViewController()
    membersVC.plan = plan

    let controller = SideMenuController()
    controller.addNewController(UINavigationController(rootViewController:planDetailsVC), forSegueType: .Center)
    controller.addNewController(membersVC, forSegueType: .Side)

    self.navigationController?.pushViewController(controller, animated: true)

`

But I get error

fatal error: unexpectedly found nil while unwrapping an Optional value

for line 402 let shouldPlaceOnLeftSide = presentationStyle == .UnderCenterPanelLeft || presentationStyle == .AboveCenterPanelLeft

NavigationBar still overlap

:( But you didn't find that the same problem exists in your sample project.
qq20160621-2 2x Can you see the title("first") blocked by NavigationBar?

Swift 3

it'd be cool to have a swift 3 version, if you have any interest to create a branch i would like to help with that.

Weird behavior when using SideMenuController subclass as initial view controller

Hi,

I wanted to use the SideMenuController as the initial view controller in my app.
The behavior is really weird in that case.

As I thought there was something wrong with my code, I tried to use your example project, and set the CustomSideMenuController as the initial view controller.
In that case, there is no button.
And if I try to drag the side menu, it does not respect the width set in the App Delegate, and "pushes" the CenterVC instead of going over it.

simulator screen shot 22 aout 2016 16 03 02

simulator screen shot 22 aout 2016 16 01 02

Let me know if you can fix that or if I have to check with another project (I would prefer the first solution because I like yours better).

Thanks
Fred

iPhone 7 problem

If I test the demo in Xcode 8 and iPhone 7 (or 7 plus) simulator, the center view controller will be white colored (or invisible) while the side menu is shown. This happens only on iPhone 7 simulator but not on iPhone 6 or iPad.

How to get the centerNavController

Hello i am working with a UIApplicationShortcutItem and i want to add stuff to the navigation controller, how can i get the centerNavController it says that my class which is a subclass of SideMenuController has no member centerNavController

Replace CenterViewController

Hi,

what is the best way to replace the CenterViewController with a new one?
e.g after selecting a something in the SideViewController?

Navigation bar with back and menu button

Hello ,

SlideMenu 3.zip

as shown in the project attached i want to move from home to second and third view controller
the problem is i try to navigate to them by push and i only get back button without menu button and i try to navigate to it using present and sideMenuController?.embedCenterController() but i only get the menu button

How can i get them both ?

Regards

Status bar appears over menu controller after updating outlets in menu controller

Hi

I'm using the library in one of my apps, and it's great!
I have encountered the following issue:

  • in the SideMenuController delegate, I used sideMenuControllerDidReveal to update an Imageview

    extension RootViewController: SideMenuControllerDelegate {
    func sideMenuControllerDidReveal(sideMenuController: SideMenuController) {
        print(#function)
    
            if let menuController = sideMenuController.sideViewController as? MenuController {
            // FIXME: causes the status bar to appear above the side menu :-(
            // Update the profile
                menuController.updateProfile()
            }
        }
    }
    
  • This method updateProfile is defined as so:

    func updateProfile() {
    // Update the user name and picture
    dispatch_async(dispatch_get_main_queue()) { 
            if let profile = UserAuth.currentUserProfile {
                self.userNameLabel.text = profile.name
                self.userImageView.sd_setImageWithURL(profile.picture, placeholderImage: UIImage(named: "user_m"))
            }
        }
    }
    

When that happens, the status bar goes OVER the side menu. Weird.

simulator screen shot 14 oct 2016 a 17 08 19

This does not happen if I comment this code.
simulator screen shot 14 oct 2016 a 17 09 22

Thanks for your help

MenuBarButtonItem image and center shadow doesn't show up

Hi,

Thanks for your work on this control and sharing it as open-source.
I've played around on this stuff and I'm stumbled with some issues.

  1. During the initial load, the menuButtonImage doesn't show up even the center ViewController is embedded with the UINavigationController.
    Otherwise, I need to call navigationController?.addSideMenuButton() but it's redundant.
  2. Setting-up the SideMenuController in AppDelegate doesn't have any effect.
    I've tried to modify some values but there's no effect (ex. centerPanelShadow, statusBehavior).
SideMenuController.preferences.drawing.menuButtonImage = UIImage(named: "menu")
SideMenuController.preferences.drawing.sidePanelPosition = .OverCenterPanelLeft
SideMenuController.preferences.drawing.sidePanelWidth = 300
SideMenuController.preferences.drawing.centerPanelOverlayColor = UIColor.darkGrayColor()
SideMenuController.preferences.drawing.centerPanelShadow = true
SideMenuController.preferences.animating.statusBarBehaviour = .ShowUnderlay

Hope you can clarify, or maybe, I've missed something. Thanks.

Please check this video link
and attach test project: TestSideMenuController.zip

Using SideMenuController in a Objective-C project

I'm adding the SideMenuController in a Objective-C project.

I can see the SideMenuController object, but I can access to the preferences property.

Is it because Preferences is an struct and they are not converted even accessible from Objective-c? Any idea if I can do anything?

Hiding or Locking SideMenu in some cases?

How can I hide sidemenu or remove after embedded?
In some cases, I need to close sidemenu. I couldn't change menu "sidePanelVisible" or embed a sidemenucontroller : nil,

Pass data from one view to another

Is there anyway I can pass data via performSegueWithIdentifier?
So I use storyboard and
sideMenuController?.performSegueWithIdentifier(DefinedSegueId, sender: nil)
To segue to a different view

NavigationBar overlap

I take a tabbar as the centerViewController,This tabbar contains three viewControllers
`let vc1 = MicroStationController()
vc1.title = "vc1"

    let nc1 = UINavigationController(rootViewController: vc1)

    let vc2 = MsgViewController()
    vc2.title = "vc2"
    let nc2 = UINavigationController(rootViewController: vc2)

    let vc3 = SearchController()
    vc3.title = "vc3"
    let nc3 = UINavigationController(rootViewController: vc3)

    let tabBarController = UITabBarController()
    tabBarController.viewControllers = [nc1, nc2, nc3]
    let nav = UINavigationController(rootViewController: tabBarController)
    self.sideMenuController?.embedSideController(LeftViewController())
    self.sideMenuController?.embedCenterController(nav)`

and then I can't see this three viewController's navigationItems

Swiping not working

Seems that only panning works and using:

SideMenuController.preferences.interaction.panningEnabled = false
SideMenuController.preferences.interaction.swipingEnabled = true

Doesn't enable swiping only

Trouble with presentViewController

Hi,
I have a problem when I use a presentViewController..
Here's my case..
I have 2 centerViewControllers (let's say A and B).
From A, I can launch a presentViewController.

1st case :
When I launch the presentViewController from A, at first time, everything is perfect. It fills all the screen.
When I show B and back to A and launch the presentViewController, I have a 20px padding that appears at the bottom (Like if the y of the presentViewController was -20px)

2nd case :
When I show B then show A and launch the presentViewController, I have the 20px padding at the bottom (Like if the y of the presentViewController was -20px)

Any help?

EDIT.
FYI. : the statusBarBehaviour property was set to .SlideAnimation
Seems to work when it sets to .ShowUnderlay

Provide option to disabled button highlight adjustment

Hi,

it would be great if we can disable image highlight adjustment in addSideMenuButton() function.

A better way would be to get the button as a return value to change/improve it ourself.

E.g: func addSideMenuButton(options?) {
button.adjustsImageWhenHighlighted = false
}

I have UITableView and Custom UIView on CenterPanel, UIPanGestureRecognizer from right to left does conflict with - tableView:commitEditingStyle:forRowAtIndexPath:

My Central ViewController is divided on 2 parts, something like this:


UITableView
UIView

and want to Use SideMenuController.presentationStyle = .UnderCenterPanelRight.
But panRecognizer from right to left has conflict with - tableView:commitEditingStyle:forRowAtIndexPath: (swipe gesture for Delete row doesn't work)

How to enable panRecognizer only for UIView?

I created sensitiveAreaForSwipe: CGRect! and get information about point of panRecognizer:

func handleCenterPanelPan(recognizer : UIPanGestureRecognizer){
        let touchPoint = recognizer.locationInView(self.view)
        if CGRectContainsPoint(sensitiveAreaForSwipe, touchPoint) {
// do things to show SideMenu
} else {
//don't do nothing
}

in this case SideMenu opens only when I swipe in UIView area.
But, UITableView still won't recognise swipe to Delete (actually, it recognise it, but I have to swipe very quickly.)

Any ideas, how to use SideMenuController with UITableView in CenterPanel?

Installation issue

Hi,
I m trying to use your library using pod.
During the compilation phase, I get 114 errors.

This is my pod file (it's an empty project)

#Uncomment the next line to define a global platform for your project 
#platform :ios, '8.0'
target 'mirroir' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'SideMenuController'
end

The install version is 0.1.5

Sorry for my ignorance but I think it's due to my swift version (3.0).

Shadow of center panel not working when opening menu via button

Hi there. Great side menu especially the control over the status bar is very nice to have 😃 .

However, I noticed that if the shadow of the center panel is activated, the shadow only seems to be drawn if the side menu is opened via the pan gesture from the edge of the screen. If the side menu is opened via the menu button, the shadow isn't drawn. I'll attach screenshots of the example project for clarification.

Shadow drawn when opened with pan gesture
screen shot 2016-07-27 at 13 35 41

Shadow not drawn when opened via menu button
screen shot 2016-07-27 at 13 35 32
#17 Also mentions shadow issues but it seems to be another issue.

Custom Preferences lost

So for the custom preferences to work, should i call them on the wrapper class instead of the app delegate like this?

class MenuWrapperViewController: SideMenuController {

    required init?(coder aDecoder: NSCoder) {
        // Configuración del menu
        SideMenuController.preferences.drawing.menuButtonImage = UIImage(named: "hamburguer");
        SideMenuController.preferences.drawing.sidePanelPosition = .UnderCenterPanelLeft;
        SideMenuController.preferences.drawing.sidePanelWidth = 300;
        SideMenuController.preferences.drawing.centerPanelShadow = true;
        SideMenuController.preferences.animating.statusBarBehaviour = .ShowUnderlay;
        super.init(coder: aDecoder);
    }

I notice that if i call first the super.init they doesn't work either.

Thanks.

Is it possible to use SideMenuController as root?

I'm not using storyboards and I set the rootViewController of the window. I've changed it so that rootViewController is SideMenuController but I only get a black window.

Is it possible to use SideMenuController as rootViewController in window?

Swift 3 Carthage support

I'm trying to update this to work with Swift 3 but Carthage is throwing a BUILD FAILED error. Tried to checkout github "teodorpatras/SideMenuController" and github "teodorpatras/SideMenuController" "swift3".

Am I missing something or no support yet?

Example not runable

Hello,

How do you get the example project to work? I've downloaded the zip but it does not build, there is no podfile included so not sure if one needed to be added. Looked like it was all included as source so thought it would just run/build.

Thanks

didSelectRowAtIndexPath Delegate / hide Slide Menu

Hello

Is it possible to create the whole project programmatically (nib files without storyboard)?

i'm facing a problem with step 4 👍

override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
    sideMenuController?.embedCenterController(someUIViewControllerInstance)
}

When i select any cell [view controller] more than one time , it's shows the slide menu table quickly and it disappear , why is that ?

Regards

can i use multiple side menu?

i want to use multiple sidemenu.

if user has not session, use A sidemenu controller
other case,use B sidemenu controller.

is it possible?

willReveal and didReveal delegate functions

I've one more thing to report: I'd really love two extra delegate functions that notify the delegate just before the side menu will reveal/hide not only after the revealing/hiding happened. If that's something you'd like to see too, I'd be happy to submit a pull request.

SideMenuController custom preferences don't take effect

First of all, thank you so much for sharing such a neatly designed Side Menu. I'm relatively new to iOS Development so this helped a lot. Not sure where to get clarification so I'm opening an issue.

Referring to the Example project, I added the following code to AppDelegate's didFinishLaunchingWithOptions method -

SideMenuController.preferences.drawing.menuButtonImage = UIImage(named: "Menu")
SideMenuController.preferences.drawing.sidePanelPosition = .OverCenterPanelLeft
SideMenuController.preferences.drawing.sidePanelWidth = 150
SideMenuController.preferences.drawing.centerPanelShadow = true
SideMenuController.preferences.animating.statusBarBehaviour = .ShowUnderlay

But changing the values of these properties doesn't seem to change anything on execution. It works fine in the Example project but not in my implementation. Any ideas on what I could possibly be doing wrong?

Push segue from center VC fired from Side menu

So i have a storyboard as follow :

screen shot 2016-09-26 at 1 28 30 pm

There is a button in my side menu that will perform a push segue from VC 3 which is the center VC of the sidemenucontroller to a soon-to-be-made VC beside VC 3, so that the nav-bar of the VC "5" will have a back button to navigate back to the center VC. How does one implement this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.