Giter Site home page Giter Site logo

ashishkakkad8 / akswiftslidemenu Goto Github PK

View Code? Open in Web Editor NEW
284.0 30.0 85.0 235 KB

Slide Menu (Drawer) in Swift

Home Page: https://ashishkakkad.com/

License: MIT License

Swift 100.00%
slide-menu swift drawer swift3 akswiftslidemenu sidemenu sidemenuswift swift4 swift5 hacktoberfest

akswiftslidemenu's Introduction

AKSwiftSlideMenu

Awesome Language

Slide Menu (Drawer) in Swift 5.0

Why to use a library everytime?

Let's create our own Slide Menu in Swift 5.0

Slide Menu Example Image

I have uploaded a video for easy way to integrate AKSwiftSlideMenu in your project :

How to integrate AKSwiftSlideMenu - iOS - Swift

I have written an article about this on my website http://ashishkakkad.com/2015/09/create-your-own-slider-menu-drawer-in-swift/ (Old article not updated with Swift versions)

Happy Coding :)

akswiftslidemenu's People

Contributors

ashishkakkad8 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

akswiftslidemenu's Issues

Changing colors of the button

Hello I would like to change the colors of the btnMenu I would like the stripes to be green instead of blue, how could I do this? thanks

Errors in BaseViewController Class

Expected expression in list of expressions on this line:

btnShowMenu.addTarget(self, action: #selector(BaseViewController.onSlideMenuButtonPressed(_:)), forControlEvents: UIControlEvents.TouchUpInside)

How to use UISplitViewController

Hi.
Could you explain how to recall a UIViewController from a menu item and a UISplitViewController from another menu item?

Thank you.
Costantino

Swift3

Is this going to be updated for Swift3?

AKSwiftSlideMenu, NavigationControllers & UIBarButtonItem BadgeValues conflict

I'm creating a shopping app, and this app has a shopping cart.

The shopping cart icon appears in most of the app's views always indicating how many items does the shopping cart has, it's a rightButtonItem inside a navigationItem.

It is now working properly. Except in the screens that are accessed using AKSwiftSlideMenu, the reason is because in all my other views I had to embed the destination view inside a navigation controller. The count of the shopping cart items is loaded when the app starts and it's stored as a global singleton that I access in all the viewDidLoads of my screens.

override func viewDidLoad() {
super.viewDidLoad()
var numeroProducto = String(Carrito.numProd)
navigationItem.rightBarButtonItem?.badgeValue = numeroProducto  
}

To give the cart Button and a badgeValue I'm using the UIBarButtonItem + Badge framework.

The problem is that the AKSwiftSlideMenu uses these methods to segue.

func openViewControllerBasedOnIdentifier(_ strIdentifier:String){
  let destViewController : UIViewController = self.storyboard!.instantiateViewController(withIdentifier: strIdentifier)

  let topViewController : UIViewController = self.navigationController!.topViewController!

  if (topViewController.restorationIdentifier! == destViewController.restorationIdentifier!){
    print("Same VC")
} else {
    self.navigationController!.pushViewController(destViewController, animated: true)
    }
}

and

func slideMenuItemSelectedAtIndex(_ index: Int32) {

let topViewController: UIViewController = self.navigationController!.topViewController!
print("View Controller is : \(topViewController) \n", terminator: "")
switch(index) {
case 0:
    print("Home\n", terminator: "")

    self.openViewControllerBasedOnIdentifier("Home")

    break

case 1:
    print("Play\n", terminator: "")

    self.openViewControllerBasedOnIdentifier("MiCuenta")

    break

case 2:
    print("Play\n", terminator: "")

    self.openViewControllerBasedOnIdentifier("QuienesSomos")

    break

case 3:
    print("Play\n", terminator: "")

    self.openViewControllerBasedOnIdentifier("NuestraCausa")

    break

case 4:
    print("Play\n", terminator: "")

    self.openViewControllerBasedOnIdentifier("Contacto")

    break

case 5:
    print("Play\n", terminator: "")

    self.openViewControllerBasedOnIdentifier("FAQ")

    break

default:
    print("default\n", terminator: "")
  }
}

So the problem is that a new Navigation controller is instantiated programmatically when I segue using the slide menu, but I don't know how to change the badgeValue of that navigation controller, any ideas?

Full Example

Is there a full example for the read me of how to get this framework up and running?

Very Hard to Do

Hi, It's very hard to implement the Code and I would love if you could do CocoaPods or something else.

Bug related to changing to same view controller

Hi,

Thanks for the work! But, I noticed a bug. To replicate:

  1. Click menu button
  2. Select the same view controller option with the one you have now
  3. Click again to menu button and it doesn't work.
  4. Click again now it works but view is messed up.

Problem is with sender.tag use. I fixed it by checking iif (view.subviews.last?.restorationIdentifier == "SlideMenuView") insted of checking for sender's tag. That seemed cleaner and more generic to me and also fixed the problem.

Also I made slidemenuvc a property of BaseViewController so that it doesn't initialize every time.

Add item in navbar?

I have two navigation bar when I want to add item on the nav bar, I can't add item on nav bar, Please help me

Not able to close custom popup view

Hi I have integrated your code in my application its working very nice, but I'm not able to remove custom pop up from application. when I remove using removefromsuperview screen is displaying blank. Please help me to resolve this.

Landscape

Hello,

Thanks for your project, it is very helpful.

I can't manage to fix the top position of the side menu when the phone is in landscape mode.
If you test it, you'll see about 20 pixels between the nabber and the sliding menu.

Can you fix it or tell me how to do?

Best regards.
Alexandre

Sidebar after rotate device

Hi Dude,
First thanks for this demo app, it's really nice.

But I've found a issue when rotate screen on iPhone 7 Plus, it preservers the top space of device.

captura de tela 2017-02-07 as 22 11 05

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.