Skip to content
/ patty Public

A reusable component for iOS apps that supports a left, right and top Hamburger menu. Written in Swift.

License

Notifications You must be signed in to change notification settings

jtribe/patty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Patty

A reusable component for iOS apps that supports a left, right and top Hamburger menu. Written in Swift. Open-sourced for the sole purpose of reusability in future projects. Expect VAST changes to this library over time.

Intro

This here's Patty. Y'all know her from The Simpsons. She's pretty...

And here she is, in all her Simpsons palette glory:

Usage

  • Ensure you have yourself a Navigation-based iOS app setup in Xcode.

  • Copy in Patty to your project no I will not use Pods

  • Open up the Storyboard and change the Navigation Controller to NavigationController -- P.S. I was told to remove the prefix I had on all the class files

  • Add in a View Controller, and set the class to SidebarViewController. Also, set the Storyboard Identifier to SidebarViewController. You can change the in-code requirement if you want to break standards in naming those however.

  • You can basically do whatever you want to the SidebarViewController. It can have a UITableView, or some buttons or if you're thinking in the mindset of an OS X Dev circa 2005, you'll pop a UINSTextView in there and use it to house your "About This App" info text.

  • The next step is to make sure each View Controller that should access the Sidebar conforms to NavigationControllerDelegate.

Control

  • Each class that wants a Sidebar should implement one, or all, of the following methods. For the sake of convenience I made these empty, and of course in the future I'll make it better.
func shouldShowLeftMenu() {}
func shouldShowRightMenu() {}
func shouldShowAccessoryMenu() {}
  • The NavigationController class asks the View Controller if it responds to any of these selectors, and if it does, shows the relevant button and allows you to show the associated Sidebar, or Topbar.

Lastly

  • This is being released under the MIT... blah blah... which means you can edit and change and use it free of charge... blah blah.

  • I only ask that if you use this, @ me on Twitter (@cocotutch) or submit a PR with improvements 😂

Thanks!

About

A reusable component for iOS apps that supports a left, right and top Hamburger menu. Written in Swift.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages