dekatotoro / SlideMenuControllerSwift

iOS Slide Menu View based on Google+, iQON, Feedly, Ameba iOS app. It is written in pure swift.
MIT License
3.4k stars 754 forks source link

Swift3 Complient? #216

Open justdan0227 opened 7 years ago

justdan0227 commented 7 years ago

Has this been updated for Swift3?

Errortype520 commented 7 years ago

3.0.0 has updated to Swift 3. Unfortunately, I had to Fork and change project settings in order to remove errors when building with Carthage.

https://github.com/Errortype520/SlideMenuControllerSwift

Hopefully this is fixed with the next official release.

justdan0227 commented 7 years ago

Can we get a bit more of an initial walk through for those of use who are new to this. The read me state:

Storyboard Support

Inherit SlideMenuController and put UIViewController in a storyboard.
Override awakeFromNib, then instantiate any view controllers

class ContainerViewController: SlideMenuController {

So if I use the default ViewController in the startup of a project do I change it to SlideMenu Controller? and if so in the example then is the ViewController then renamed to ContainerViewController?

Would really love to see step by step for a walk through Thanks!

zirinisp commented 7 years ago

The fix is very easy all that has to be done is set in the build settings the option 'Use Legacy Swift Language Version' to 'no'.

Then it works.

@Errortype520 have you created a pull request, so the creator can merge it?

justdan0227 commented 7 years ago

What fix.. I'm asking for a walk through example of how this is done with all of the storyboard assets in a working example.

zirinisp commented 7 years ago

@justdan0227 Errortype520 had to fork in order to use it with Swift 3. Unfortunately Swift 3 does not compile with carthage as the legacy swift is set to undefined. This is the fix I am talking about.

For a walk through example have a look at the read file and if i remember correctly an example is included.

zirinisp commented 7 years ago

In any case I created pull request #223 .

justdan0227 commented 7 years ago

So I'm still missing the concept here. If I follow the readme it state to insert this in your AppDelegate.swift.

let slideMenuController = SlideMenuController(mainViewController: mainViewController, leftMenuViewController: leftViewController, rightMenuViewController: rightViewController) self.window?.rootViewController = slideMenuController self.window?.makeKeyAndVisible()

However what is mainViewController, LeftViewController and rightViewController? Where are they defined to AppDelegate.swif?

UPDATE: So I'm going to update that this by saying that I took the project file from here and downloaded it and now working through the example. Want to start off with a basic one first and then add.

Question: How do you show a simple UIViewController before the MainViewController gets control (like a splash or login view controller); then I want to go to the MainViewController; as well as return to the LoginViewController if the user "logs out"...

I tried moving the entry point in InterfaceBuilder however the AppDelegate is what sets the rootview controller to Menu