Skip to content

Commit

Permalink
fix bug of pathComponents from route
Browse files Browse the repository at this point in the history
  • Loading branch information
smhjsw committed Jun 24, 2016
1 parent b329c01 commit 94eddec
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 2 deletions.
Binary file added .DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions HHRouter/HHRouter.m
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ - (NSDictionary *)paramsInRoute:(NSString *)route
params[@"route"] = [self stringFromFilterAppUrlScheme:route];

NSMutableDictionary *subRoutes = self.routes;
NSArray *pathComponents = [self pathComponentsFromRoute:[self stringFromFilterAppUrlScheme:route]];
NSArray *pathComponents = [self pathComponentsFromRoute:params[@"route"]];
for (NSString *pathComponent in pathComponents) {
BOOL found = NO;
NSArray *subRoutesKeys = subRoutes.allKeys;
Expand Down Expand Up @@ -174,7 +174,7 @@ - (NSMutableDictionary *)routes
- (NSArray *)pathComponentsFromRoute:(NSString *)route
{
NSMutableArray *pathComponents = [NSMutableArray array];
for (NSString *pathComponent in route.pathComponents) {
for (NSString *pathComponent in [NSURL URLWithString:route].path.pathComponents) {
if ([pathComponent isEqualToString:@"/"]) continue;
if ([[pathComponent substringToIndex:1] isEqualToString:@"?"]) break;
[pathComponents addObject:pathComponent];
Expand Down
Binary file added HHRouterExample/.DS_Store
Binary file not shown.
Binary file added HHRouterExample/Images.xcassets/.DS_Store
Binary file not shown.

0 comments on commit 94eddec

Please sign in to comment.