Closed reckonsys-zz closed 8 years ago
how do u import this library from cocoapods? or manual?
from cocoapods
I think cocoapods is not fully supported yet.Even me,i have to import manually by copying SlideMenuController.swift to my project location.Please see for your self - https://github.com/dekatotoro/SlideMenuControllerSwift/issues/35 . Sometime due xcode 6.3 problem on large project,you might have to clean the whole project and try to rebuild again.
I manually Copied but still not able to import
May be some problem with file from SlideMenuController.
I guess not.I think there is something wrong with your project structure.If u want to be sure,try to create new project and import the SlideMenuViewController.swift manually into your project and use it because i have the same issue like yours which i cant install from cocoapods but,can import manually and work fine for now.
@reckonsys How do you try to do with the latest?
i am not using it app.
Cocoapods is already fully supported. Close this issue.
Hello,
I've succesfully imported the SlideMenuController from cocoapods.
The problem is that i can not add right and left buttons with the method addRightBarButtonWithImage and addLeftBarButtonWithImage
Please suggest...
How did you import the SlideMenuController?
Hello,
I've imported it with creating a podfile and pod install command.
import UIKit import SlideMenuControllerSwift
@UIApplicationMain class AppDelegate: UIResponder ,UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch
// create viewController code..
let storyboard = UIStoryboard(name: "Main", bundle: NSBundle(identifier: "com.mobilentis.jetforme"))
let mainViewController = storyboard.instantiateViewControllerWithIdentifier("MainViewController") as! MainViewController
let leftViewController = storyboard.instantiateViewControllerWithIdentifier("MenuViewController") as! MenuViewController
let slideMenuController = SlideMenuController(mainViewController: mainViewController, leftMenuViewController: leftViewController)
self.window?.rootViewController = slideMenuController
self.window?.makeKeyAndVisible()
return true
}
I don't see the code you added the menu button.
// // ViewController.swift // jetforme // // Created by Elif on 03/03/16. // Copyright © 2016 Elif. All rights reserved. //
import UIKit import SlideMenuControllerSwift
class MainViewController: SlideMenuController {
override func viewDidLoad() {
super.viewDidLoad()
self.view.addBackgroundImage()
}
override func awakeFromNib() {
if let controller = self.storyboard?.instantiateViewControllerWithIdentifier("MenuViewController") {
self.leftViewController = controller
}
super.awakeFromNib()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
addLeftBarButtonWithImage(UIImage(named: "ic_menu_black_24dp.png")!)
}
}
Yes, the left(or right) menu button are added in the navigationBar, but you don't use the UINavigationController.So when you add the menu is useless.
Do you have a sample project this library? It would be really helpfull?
https://github.com/dekatotoro/SlideMenuControllerSwift/ This is the sample project and you can download it for references.
I know this but this is not a sample project, this is the whole project I think? No?
Okay, I change the code you provided for you.
......
let slideMenuController = SlideMenuController(mainViewController: mainViewController, leftMenuViewController: leftViewController)
// Add this line
let navController = UINavigationController(rootViewController: slideMenuController)
// And change the rootViewController from slideMenuController into navController
self.window?.rootViewController = navController
......
Thank you very much...
You are welcome.
tried to copy file , still get the issue that , saying module not found , created a sample project event , still the same issue
when i import showing No such Module.