Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Huohua/HHRouter
Browse files Browse the repository at this point in the history
  • Loading branch information
lightory committed Mar 21, 2014
2 parents 6ba63d2 + 5da56b5 commit 7a61567
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions HHRouter/HHRouter.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ @implementation HHRouter

+ (instancetype)shared
{
static HHRouter *router;
@synchronized(self) {
static HHRouter *router = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
if (!router) {
router = [[self alloc] init];
}
}
});
return router;
}

Expand Down Expand Up @@ -126,6 +127,7 @@ - (NSArray *)pathComponentsFromRoute:(NSString *)route

- (NSString *)stringFromFilterAppUrlScheme:(NSString *)string
{
//filter out the app URL compontents.
for (NSString *appUrlScheme in [self appUrlSchemes]) {
if ([string hasPrefix:[NSString stringWithFormat:@"%@:", appUrlScheme]]) {
return [string substringFromIndex:appUrlScheme.length + 1];
Expand Down

0 comments on commit 7a61567

Please sign in to comment.