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

how can i register my domain? #15

Closed
ivanyang1984 opened this issue Dec 12, 2015 · 2 comments
Closed

how can i register my domain? #15

ivanyang1984 opened this issue Dec 12, 2015 · 2 comments

Comments

@ivanyang1984
Copy link

If i have an url like http://www.ls.com/shopItemList.htm
the shopItemList.htm would like to mount to LSSShopItemListViewController
how can i do the register?
now i write the code like below

[self.router.registrar registerAppRoutePath:@"shopItemList{LSSShopItemListViewController}"
                           presentingController:[self.navigationControllerDic objectForKey:@"LSShopNavigationController"]]

it matches failed. then i drilled into your code, there was a separation operation will separate the m.ls.com and shopItemList then you tried to company the count of path components
like

// If the count is not the same and there is no wildcard, no way this can match
    // Same if the route has less components than the pattern
    if (
        ([routePathComponents count] != [self.patternPathComponents count] && !self.patternHasWildcard)
        ||
        ([routePathComponents count] < [self.patternPathComponents count])
        ) {
        return NO;
    }
@ivanyang1984
Copy link
Author

i found it, i just replace my domain to @"" then it works
like

NSString *innerPath = [URL.absoluteString stringByReplacingOccurrencesOfString:@"m.ls.com/" withString:@""];
        handleUrl = [self.router handleURL:[NSURL URLWithString:innerPath]];

@ipodishima
Copy link
Contributor

There is no such notion of a domain on the router. However, I might have some code to add in order to remove the domain from http[s] urls

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