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

registerHandlerClass function is not there? #111

Closed
borek2 opened this issue Sep 16, 2016 · 19 comments
Closed

registerHandlerClass function is not there? #111

borek2 opened this issue Sep 16, 2016 · 19 comments

Comments

@borek2
Copy link

borek2 commented Sep 16, 2016

I have been upgrading to swift 3 for the passed hours i have put everything to work, except for DeepLinkKit. I am not able to find the function registerHandlerClass anymore. The weird thing is it is in the DPLDeepLinkRouter.h but when i command click on DeepLinkKit within my own code i get the following:

dlk

I am not sure that this is a problem I have or this is a problem in the pod. I have deleted the pods, deleted Podfile.lock, deleted derived data, cleaned my project, everything, but it still doesn't show up. Does anyone know what to do?

@chrismaddern
Copy link
Contributor

@borek2 I'm assuming that the header is in swift syntax because it was run through a Swift conversion? It looks like that converter made an error on interpreting the registerHandlerClass: method... although I'm not entirely sure why.

How is DLK being imported? With an umbrella header import you should be able to leave this as Objective C syntax, no?

@borek2
Copy link
Author

borek2 commented Sep 17, 2016

Thanks for the quick reply @chrismaddern !

I have added DeepLinkKit as a static library now (to use the Objective C syntax as you proposed), and it still gives problems. The actual function is there now, but i am not able to get a reference to it. With some trial and error (I am not very skillful in Objective-C) i noticed the following:

This is the line that gives problems:

- (void)registerHandlerClass:(Class <DPLRouteHandler>)handlerClass forRoute:(NSString *)route;

When i use another class in instead of DPLRouteHandler it works fine (as, i can reference to it). But here is when it will cause problems. If you use a protocol (i created a new one to test this), it will fail to make a reference.

Sorry if it sounds a little vague, i only program in Swift so Objective C is sometimes a little vague to me. Might this problem have something to do with xCode 8?

@borek2
Copy link
Author

borek2 commented Sep 17, 2016

Again it might be my lack of knowledge of Objective C, though in my understanding within the code DPLRouteHandler is both a protocol and a class? It is declared as a protocol in the file DPLDeepLinkRouter.h. But it has a class implementation in DPLRouteHandler.h and DPLRouteHandler.m (this shouldnt be allowed right, again maybe in Objective C i am missing something ;)). Is it a naming problem maybe? I think he is unable to infer DPLRouteHandler as a protocol

@doohoo
Copy link

doohoo commented Sep 18, 2016

+1, In the same seat as @borek2.

@chrismaddern
Copy link
Contributor

@doohoo @borek2 It looks likely that there may have to be an interface change and bump to 2.0.0 for support for Xcode 8 / Swift 3.

We'll take a look in the early week and try to get something out asap!

In the meantime, if either of you find a sensible interface change that works, feel free to fork / share.

@borek2
Copy link
Author

borek2 commented Sep 19, 2016

@chrismaddern Will look into it! Thanks for the help!

@aborren
Copy link

aborren commented Sep 19, 2016

I'm in the same situation. Hope you're able to sort it out asap 👍

@pavelpantus
Copy link
Contributor

Hi @borek2 , thanks for reporting the issue.
This branch should fix the problem.
You can try it like this:

pod 'DeepLinkKit', :git => 'git@github.com:button/DeepLinkKit.git', :branch => 'pavel/111_registerHandlerClass_swift3_interface'

@borek2
Copy link
Author

borek2 commented Sep 21, 2016

Awesome! Thanks so much! I will be testing this tomorrow @pantuspavel

@aborren
Copy link

aborren commented Sep 21, 2016

It seems to work 👍 Thanks @pantuspavel

pavelpantus added a commit that referenced this issue Sep 22, 2016
…ift3_interface

#111 - registerHandlerClass:forRoute: interface is generated for Swift 3
@doohoo
Copy link

doohoo commented Sep 26, 2016

Anyone got this working using Pods?

@pavelpantus
Copy link
Contributor

@doohoo Hi!
PR in question was merged into master.
Please try:

pod 'DeepLinkKit', :git => 'git@github.com:button/DeepLinkKit.git', :branch => 'master'

@pavelpantus
Copy link
Contributor

We restored fix branch, so you can try:

pod 'DeepLinkKit', :git => 'git@github.com:button/DeepLinkKit.git', :branch => 'pavel/111_registerHandlerClass_swift3_interface'

@doohoo
Copy link

doohoo commented Sep 26, 2016

@pantuspavel it didn't go to well.

Basically get:

Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Thanks for your time and help.

@pavelpantus
Copy link
Contributor

pavelpantus commented Sep 26, 2016

@doohoo , seems like server rejects your connection.
Have you gone through this guide?

@doohoo
Copy link

doohoo commented Sep 26, 2016

Hehe, something is messup. Will check it out 👀 . Thanks.

@doohoo
Copy link

doohoo commented Sep 26, 2016

@pantuspavel just went for the https way instead :)
Thanks for your help.

@pavelpantus
Copy link
Contributor

No problem!
Glad it worked out for you.

@wessmith
Copy link
Member

Sorry this took so long. The change is available now in 1.2.2

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

No branches or pull requests

6 participants