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

I cannot get the delegate methods to work on Swift #5

Closed
moyoteg opened this issue Jul 17, 2015 · 4 comments
Closed

I cannot get the delegate methods to work on Swift #5

moyoteg opened this issue Jul 17, 2015 · 4 comments
Labels

Comments

@moyoteg
Copy link

moyoteg commented Jul 17, 2015

No description provided.

@moyoteg moyoteg changed the title Can this run under Swift? I cannot get the delegate methods to work on Swift Jul 17, 2015
@chenzeyu
Copy link
Owner

It is supposed to work on Swift with cocoapods' use_frameworks! on.
However I have the same problem making the delegate & dataSource working.
I'm currently digging into this issue and aim to resolve it asap.

@moyoteg
Copy link
Author

moyoteg commented Jul 20, 2015

Found the solution! you just have to change the name of the delegate methods, for example instead of naming the method:
optional func CZPickerView(pickerView: CZPickerView!, didConfirmWithItemAtRow row: Int)

change it to:
optional func czPickerView(pickerView: CZPickerView!, didConfirmWithItemAtRow row: Int)

http://stackoverflow.com/questions/30033523/what-is-wrong-that-shows-use-of-undeclared-type-after-adding-an-function

@chenzeyu
Copy link
Owner

Hey moyoteg, that's great, thanks for what you have found.

Actually the original names did not conform to Apple's naming conventions, though it works fine in obj-c. I've changed all protocol methods' names to start with lowercases and now it works in swift!

Fixed in 0.3.5 a733555

@moyoteg
Copy link
Author

moyoteg commented Jul 22, 2015

Thank you!

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

No branches or pull requests

2 participants