button / DeepLinkKit

A splendid route-matching, block-based way to handle your deep links.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

registerHandlerClass function is not there?

borek2 opened this issue · comments

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?

@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?

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?

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

commented

+1, In the same seat as @borek2.

@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.

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

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

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'

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

It seems to work 👍 Thanks @pantuspavel

commented

Anyone got this working using Pods?

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

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

We restored fix branch, so you can try:

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

@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.

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

commented

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

commented

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

No problem!
Glad it worked out for you.

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