Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use in Objective-C project #9

Closed
andyden9 opened this issue Jan 16, 2018 · 13 comments
Closed

Use in Objective-C project #9

andyden9 opened this issue Jan 16, 2018 · 13 comments

Comments

@andyden9
Copy link

Hi Kawoou,

I'm using your framework through CocoaPods, I use it exactly as your instruction, but storyboard failed to init DrawerController and returns a plain UIViewController as the initial ViewController. Do you happen to know what's the issue here? Thank you so much in advance!

2018-01-16 6 26 29

2018-01-16 6 26 35

2018-01-16 6 26 43

2018-01-16 6 26 48

@kawoou
Copy link
Owner

kawoou commented Jan 17, 2018

Hi andyden9.
You say mean that even if you specify a "Custom Class" in the identity inspector, it is initialized as if the default UIViewController.

@andyden9
Copy link
Author

andyden9 commented Jan 17, 2018

Yes exactly, do you happen to know what caused this? I've stuck on this for more than 5 hrs😭

2018-01-17 10 52 24

2018-01-17 11 14 35

@kawoou
Copy link
Owner

kawoou commented Jan 17, 2018

I mean the ViewController with "left" or "main".
How did you find out that the DrawerController was initialized with a pure UIViewController?

@andyden9
Copy link
Author

andyden9 commented Jan 17, 2018

Oh sorry, lol, because I set the DrawerController as the initial View Controller, and after storyboard init, I only got a blank UIViewController as I showed in the debug view hierarchy. Are you busy today? Could you add my wechat(anddddddy) or skype(appleandy94) to instruct me a bit if you're available?

2018-01-17 10 52 24

2018-01-17 11 14 35

I got them all set:
2018-01-16 6 26 48
2018-01-16 6 26 43
2018-01-16 6 26 35

The only difference between your demo and my project I can find is, the demo is a pure swift project, and mine is a pure objective-c project....

@andyden9
Copy link
Author

Sorry my bad, it seems showing the '😭' label, so DrawerController is inited, I guess the problem is the DrawerController not showing the 'main' controller.

2018-01-17 11 57 43

If it works, simulator should show this:

2018-01-17 12 02 00

@andyden9
Copy link
Author

andyden9 commented Jan 17, 2018

2018-01-17 12 33 58

I found something else, though it's correctly set in the story board as shown(in previous messages), the viewDidLoad method in DrawerController never gets called....

@kawoou
Copy link
Owner

kawoou commented Jan 17, 2018

You use the swift library in the objective-c project.
If so, did you specify a bridge header?

This symptom seems to be similar to what happens when a Custom Class is incorrectly specified.

@andyden9
Copy link
Author

Yes I am using the KWDrawerController as the only swift library in my objective-c project 😱 and I didnt' specify a bridge header since I thought CocoaPods will automatically generate it for me..... I guess that's the issue, let me try to specify a header manually. Thank you Kawoou! 🙏

@kawoou
Copy link
Owner

kawoou commented Jan 17, 2018

Fortunately!
Happy Development😆

@kawoou kawoou closed this as completed Jan 17, 2018
@andyden9
Copy link
Author

andyden9 commented Jan 17, 2018

Hi Kawoou!

Storyboard is still no luck for me so I switched to code, and I've found an issue, that the setViewController:side: method in DrawerController maybe duplicated with some system method so OC can't find this method.

After rename this to setVController:side: I can use it and everything just work out fine in OC.

May I submit a pull request to fix this? Just name changing.

Cheers,
Andy

@andyden9
Copy link
Author

2018-01-17 3 35 56

@kawoou
Copy link
Owner

kawoou commented Jan 17, 2018

It's really weird in objc!

PR is always welcome, even with small modifications 👍
Thank you for using this project.

@andyden9
Copy link
Author

Thank you for sharing this great library! I've submitted the PR, please review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants