Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Would Accent Correction be Considered? #26

Closed
NorthStar opened this issue Aug 8, 2014 · 1 comment · Fixed by #28
Closed

Would Accent Correction be Considered? #26

NorthStar opened this issue Aug 8, 2014 · 1 comment · Fixed by #28

Comments

@NorthStar
Copy link
Contributor

There are several reasons for using idiomatic modern Objective-C in Routable, including improved readability and easier maintenance. So I propose that you consider a pull request I am about to send by the end of today.

Many of my concerns are style-related even though the caveats in usage are small. While the changed Routable-iOS obscures the parallelism between its Android counterparts, using alloc to allocate memory and init or custom init is preferred over 'new' or a custom 'new' in modern Objective-C, for instance.

@implementation Routable

static Routable *_sharedRouter = nil;

+ (Routable *)sharedRouter {
    static dispatch_once_t oncePredicate;
    dispatch_once(&oncePredicate, ^{
        _sharedRouter = [[Routable alloc] init];
    });
    return _sharedRouter;
}

This shows what I'd like to use.

I understand that the current implementation might be more helpful to many. I am in no way a master at this but I think more Objective-C programmers think like me; I can merely propose this change to you with no attached authority.

(Meanwhile, here is my personal motivation: I have changed my fork greatly. It would be hard for me to continue using the library's future updates if the library does not change its style.)

@clayallsopp
Copy link
Owner

Sure - this library was written awhile ago, and Objective-C style moves quickly. As long as your changes are backwards-compatible then it's cool

NorthStar added a commit to NorthStar/routable-ios that referenced this issue Aug 13, 2014
fixes clayallsopp#26
Objective-C specific syntax fixes:
  Verbose naming of methods, adhering to naming conventions
  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.
Completely backward compatible
Other caveats that came with idiomatic Objective-C
  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
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?
Functionality \todo: have both call back and ‘open’ in options.
--

Objective-C specific syntax fixes:
	Verbose naming of methods
	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.
Completely backward compatible
Safer setObject:forKey: by having early returns if there is no explicit format to prevent crash
Simplified logic in loops, using faster enumeration with blocks
Add explicit factory class methods for constructions
Add default routerOptions
——
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?
——
Functionality todo: have both call back and ‘open’.

Minor fixes on documentation and slight logic unrolling

Changed spacing back.

Minor change; separated two issues.

reverted example app to Aug 5.

more sample app struggle.

Fixed paramsForUrlComponents:routerUrlComponents:
@NorthStar NorthStar mentioned this issue Aug 13, 2014
sweetverbs added a commit to sweetverbs/routable-ios that referenced this issue Apr 22, 2015
* addTestsForExtraParams:
  Update to XCTest, add tests for extraParams, fix bug where extraParams were not updated for cached url
  Fixed spacing
  Adds extraParams to openUrl to allow more robust data passing through routing when a controller decides to open an url
  Fixed a type
  Mainly an accent change to use Objective-C style. fixes clayallsopp#26 Objective-C specific syntax fixes:   Verbose naming of methods, adhering to naming conventions   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. Completely backward compatible Other caveats that came with idiomatic Objective-C   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 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? Functionality \todo: have both call back and ‘open’ in options. --
  [clayallsopp#24] Example App has essential buttons hidden under nav bar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants