Skip to content

Commit

Permalink
1.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldev committed Oct 2, 2016
1 parent 4321688 commit 269c8b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions JLRoutes.podspec
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Pod::Spec.new do |s|
s.name = "JLRoutes"
s.version = "1.6.2"
s.version = "1.6.3"
s.summary = "URL routing library for iOS with a simple block-based API."
s.homepage = "https://github.com/joeldev/JLRoutes"

s.license = "BSD 3-Clause \"New\" License"

s.author = { "Joel Levin" => "joel@joeldev.com" }
s.source = { :git => "https://github.com/joeldev/JLRoutes.git", :tag => "1.6.2" }
s.source = { :git => "https://github.com/joeldev/JLRoutes.git", :tag => "1.6.3" }

s.source_files = 'JLRoutes', 'JLRoutes/*.{h,m}'
s.framework = 'Foundation'
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ JLRoutes is available for installation using CocoaPods or Carthage (add `github

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// ...
[JLRoutes addRoute:@"/user/view/:userID" handler:^BOOL(NSDictionary *parameters) {
[[JLRoutes globalRoutes] addRoute:@"/user/view/:userID" handler:^BOOL(NSDictionary *parameters) {
NSString *userID = parameters[@"userID"]; // defined in the route by specifying ":userID"
// present UI for viewing user with ID 'userID'
return YES; // return YES to say we have handled the route
Expand Down Expand Up @@ -82,7 +82,7 @@ It is also important to note that if you pass nil for the handler block, an inte
### More Complex Example ###

```objc
[JLRoutes addRoute:@"/:object/:action/:primaryKey" handler:^BOOL(NSDictionary *parameters) {
[[JLRoutes globalRoutes] addRoute:@"/:object/:action/:primaryKey" handler:^BOOL(NSDictionary *parameters) {
NSString *object = parameters[@"object"];
NSString *action = parameters[@"action"];
NSString *primaryKey = parameters[@"primaryKey"];
Expand Down Expand Up @@ -119,7 +119,7 @@ JLRoutes supports setting up routes within the namespace of a given URL scheme.
However, if you decide that you do need to handle multiple schemes with different sets of functionality, here is an example of how to do that:

```objc
[JLRoutes addRoute:@"/foo" handler:^BOOL(NSDictionary *parameters) {
[[JLRoutes globalRoutes] addRoute:@"/foo" handler:^BOOL(NSDictionary *parameters) {
// This block is called if the scheme is not 'thing' or 'stuff' (see below)
return YES;
}];
Expand All @@ -140,7 +140,7 @@ This example shows that you can declare the same routes in different schemes and
Continuing with this example, if you were to add the following route to the collection above:
```objc
[JLRoutes addRoute:@"/global" handler:^BOOL(NSDictionary *parameters) {
[[JLRoutes globalRoutes] addRoute:@"/global" handler:^BOOL(NSDictionary *parameters) {
return YES;
}];
```
Expand All @@ -161,7 +161,7 @@ JLRoutes supports setting up routes that will match an arbitrary number of path
For example, the following route would be triggered for any URL that started with `/wildcard/`, but would be rejected by the handler if the next component wasn't `joker`.
```objc
[JLRoutes addRoute:@"/wildcard/*" handler:^BOOL(NSDictionary *parameters) {
[[JLRoutes globalRoutes] addRoute:@"/wildcard/*" handler:^BOOL(NSDictionary *parameters) {
NSArray *pathComponents = parameters[kJLRouteWildcardComponentsKey];
if ([pathComponents count] > 0 && [pathComponents[0] isEqualToString:@"joker"]) {
// the route matched; do stuff
Expand All @@ -171,7 +171,7 @@ For example, the following route would be triggered for any URL that started wit
// not interested unless the joker's in it
return NO;
}];
```
```


### Optional routes ###
Expand All @@ -186,9 +186,9 @@ JLRoutes supports setting up routes with optional parameters. At the route regis
### License ###
BSD 3-Clause License:
> Copyright (c) 2016, Joel Levin. All rights reserved.
> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
>* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of JLRoutes nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
Expand Down

0 comments on commit 269c8b4

Please sign in to comment.