Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

More documentation cleanup.

  • Loading branch information...
commit 7be7ad8287aac1635eccc8d7e94050d04baca580 1 parent 0fef00c
@jverkoey jverkoey authored
Showing with 28 additions and 15 deletions.
  1. +18 −7 README.mdown
  2. +10 −8 SOCKit.h
View
25 README.mdown
@@ -26,7 +26,7 @@ Damn straight it is.
### And isn't this kind of like Three20's navigator?
Except hella better. It's also entirely incompatible with Three20 routes. This kinda blows if
-you've already invested a ton of energy into Three20's routing tech, but here's a few reasons
+you've already invested a ton of energy into Three20's routing tech, but here are a few reasons
why SOCKit is better:
1. *Selectors are not defined in the pattern*. The fact that Three20 requires that you define
@@ -48,16 +48,17 @@ Three20: [map from:[Tweet class] name:@"thread" toURL:@"twitter://tweet/(id)/thr
SOCKit: [map from:[Tweet class] name:@"thread" toURL:@"twitter://tweet/:id/thread"];
```
-## Heads up
+## Where it's being used
-SOCKit is a sibling project to [Nimbus][], a lightweight modular framework that makes it easy to
-blaze a trail with your iOS apps. Nimbus will soon be using SOCKit in a re-envisioning of Three20's
-navigator.
+SOCKit is a sibling project to [Nimbus][], a light-weight and modular framework that makes it
+easy to blaze a trail with your iOS apps. Nimbus will soon be using SOCKit in a re-envisioning
+of Three20's navigator.
Users of RESTKit will notice that SOCKit provides similar functionality to RESTKit's
-[RKMakePathWithObject][]. In fact, both `RKMakePathWithObject` and the underlying `RKPathMatcher` class rely on SOCKit behind the scenes.
+[RKMakePathWithObject][]. In fact, both `RKMakePathWithObject` and the underlying `RKPathMatcher`
+class rely on SOCKit behind the scenes.
-## Add SOCKit to your project
+## Adding SOCKit to your project
This lightweight library is built to be a dead-simple airdrop directly into your project. Contained
in SOCKit.h and SOCKit.m is all of the functionality you will need in order to start mapping
@@ -76,6 +77,16 @@ the `user` property, and that TwitterUser object has a `username` property. Chec
`:user.username`. If this was one of my tweets and I encoded the Tweet object using a SOCKit
pattern the resulting string would be `@"featherless"`. KVC rocks.
+## Learning more
+
+In-depth documentation can be found in the [SOCKit.h][SOCPattern] header file.
+
+## Contributing
+
+If you find a bug in SOCKit please file an issue on the Github [SOCKit issue tracker][]. Even
+better: if you have a solution for the bug then fork the project and make a pull request.
+
+[SOCKit issue tracker]: https://github.com/jverkoey/sockit/issues
[SOCPattern]: https://github.com/jverkoey/sockit/blob/master/SOCKit.h
[KVC collection operators]: http://developer.apple.com/library/ios/#documentation/cocoa/conceptual/KeyValueCoding/Articles/CollectionOperators.html#//apple_ref/doc/uid/20002176-BAJEAIEE
[Nimbus]: http://jverkoey.github.com/nimbus
View
18 SOCKit.h
@@ -28,7 +28,7 @@
* Patterns, once created, can be used to efficiently turn objects into strings and
* vice versa. Respectively, these techniques are referred to as inbound and outbound.
*
- * Inbound example (creating a string from an object):
+ * Inbound examples (creating strings from objects):
*
* pattern: api.github.com/users/:username/gists
* > [pattern stringFromObject:[GithubUser userWithUsername:@"jverkoey"]];
@@ -38,7 +38,7 @@
* > [pattern stringFromObject:[GithubRepo repoWithUsername:@"jverkoey" repo:@"sockit"]];
* returns: api.github.com/repos/jverkoey/sockit/issues
*
- * Outbound example (performing a selector on an object with values from a given string):
+ * Outbound examples (performing selectors on objects with values from given strings):
*
* pattern: github.com/:username
* > [pattern performSelector:@selector(initWithUsername:) onObject:[GithubUser class] sourceString:@"github.com/jverkoey"];
@@ -62,20 +62,22 @@
* get around to wanting to decode the string back into an object we need some sort of
* delimiter between the parameters.
*
- * Note 2: When colons aren't parameters
+ * Note 2: When colons aren't seen as parameters
*
* If you have colons in your text that aren't followed by a valid parameter name then the
* colon will be treated as static text. This is handy if you're defining a URL pattern.
* For example: @"http://github.com/:user" only has one parameter, :user. The ":" in http://
- * is ignored.
+ * is treated as a string literal and not a parameter.
*
* Note 3: Escaping KVC characters
*
- * If you need to use a KVC character in a SOCKit pattern as a literal string token and not
- * a KVC character then you can escape the character using a double backslash. For example,
+ * If you need to use KVC characters in SOCKit patterns as literal string tokens and not
+ * treated with KVC then you must escape the characters using double backslashes. For example,
* @"/:userid.json" would create a pattern that uses KVC to access the json property of the
- * username value. In this case we wish to interpret the ".json" portion as a static string.
- * In order to do so we escape the "." using a double backslash: "\\.". For example:
+ * username value. In this case, however, we wish to interpret the ".json" portion as a
+ * static string.
+ *
+ * In order to do so we must escape the "." using a double backslash: "\\.". For example:
* @"/:userid\\.json". This makes it possible to create strings of the form @"/3.json".
* This also works with outbound parameters, so that the string @"/3.json" can
* be used with the pattern to invoke a selector with "3" as the first argument rather
Please sign in to comment.
Something went wrong with that request. Please try again.