usepropeller/routable-ios — pull request #27 by NorthStar (2014-08-12 23:02:27+00:00)
Title: Use Objective-C Style + Light Refactoring; Backward Compatible

0. fixes #26
1. Objective-C specific syntax fixes:
*	Verbose naming of methods, adhering to [naming conventions](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CodingGuidelines/CodingGuidelines.html)
*	Passive return for nil values
*	No need to synthesize
*	Eliminate nil checks through ‘==‘
*	Eliminate more ‘new’ as allocation and initialization should be separated.
*	Use custom initialization for dictionaries and arrays for safer type
*	Separation of allocation and initialization: no more allocating memory when we don’t have to.
2. Completely backward compatible
3. Other caveats that came with idiomatic Objective-C
* Completely backward compatible
* Safer setObject:forKey: by having early returns if there is no explicit format (to prevent crash)
* Simplified logic in conditions
* Simplified(?) loops through routes using faster enumeration with blocks
* Add explicit factory class methods for constructions
* Add default routerOptions
3. Want to do (but didn't/haven't) to adhere to usual Objective-C style
* Want to get rid of custom new (newRouter)
* Want to have better error handling; no more exception throwing so we get verbose debugging info
* Want to simplify controllerForRouterParams and routerParamsForUrl more
* Want to get rid of register_name by defining selector macros
* Want to replace property shouldOpenAsRootViewController in routerOptions into root’ with getter ‘isRoot’ to parallel modal
* Not sure: routerOptions: want to not have wrappers around setters but users might want to keep DSL-style chaining.
* Not sure: should I fix spacing more?
* Not sure: should callback in options be overridden, ever?
4. Functionality \todo: have both call back and ‘open’ in options.