iOS Slide View based on iQON, Feedly, Google+, Ameba iPhone app.
##Installation
####CocoaPods comming soon...
####Manually
Add the SlideMenuController.swift
file to your project.
##Usage
###Setup
In your app delegate:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// create viewController code...
let slideMenuController = SlideMenuController(mainViewController: mainViewController, leftMenuViewController: leftViewController, rightMenuViewController: rightViewController)
self.window?.rootViewController = slideMenuController
self.window?.makeKeyAndVisible()
return true
}
If you want to use the custom option, please change the SlideMenuOption class.
class SlideMenuOption {
let leftViewWidth: CGFloat = 270.0
let leftBezelWidth: CGFloat = 16.0
let contentViewScale: CGFloat = 0.96
let contentViewOpacity: CGFloat = 0.5
let shadowOpacity: CGFloat = 0.0
let shadowRadius: CGFloat = 0.0
let shadowOffset: CGSize = CGSizeMake(0,0)
let panFromBezel: Bool = true
let animationDuration: CGFloat = 0.4
let rightViewWidth: CGFloat = 270.0
let rightBezelWidth: CGFloat = 16.0
let rightPanFromBezel: Bool = true
let hideStatusBar: Bool = true
let pointOfNoReturnWidth: CGFloat = 44.0
init() {
}
}
###You can access from UIViewController
self.slideMenuController()?
or
if let slideMenuController = self.slideMenuController() {
// some code
}
viewController.addLeftBarButtonWithImage(UIImage(named: "hoge")!)
viewController.addRightBarButtonWithImage(UIImage(named: "fuga")!)
// Open
self.slideMenuController()?.openLeft()
self.slideMenuController()?.openRight()
// close
self.slideMenuController()?.closeLeft()
self.slideMenuController()?.closeRight()
Requires iOS 7.0 and ARC.
- Highly customizable
- Complete example
Forks, patches and other feedback are welcome.
SlideMenuControllerSwift is available under the MIT license. See the LICENSE file for more info.