puls / objc-codegenutils

Three small tools to help you meet Xcode halfway.
Other
507 stars 26 forks source link

Adds class methods and strongly typed return values. #8

Open swiftal64 opened 10 years ago

swiftal64 commented 10 years ago

See the updated example project for how category methods and strong types work.

Here's a quick example:

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:CGTAMainStoryboardName bundle:nil];
CGTADetailViewController *detailViewController = [storyboard instantiateViewControllerWithIdentifier:CGTAMainStoryboardDetailViewControllerIdentifier];

becomes

CGTADetailViewController *detailViewController = [CGTAMainStoryboard instantiateDetailViewController];

Segues, collection view cells, and table view cells are scoped to the view controller.

puls commented 10 years ago

This is amazing. But let's not introduce a mode. Please just change the behavior.

swiftal64 commented 10 years ago

I removed the mode and added some class generator methods (instead of printing strings). Let me know what you think.

swiftal64 commented 10 years ago

I implemented your recommendations, and added a new storyboard feature which caches the constraint constant values. If you think this should be a separate feature, let me know and I'll put it into another branch.

swiftal64 commented 10 years ago

In regards to the first comment about floating point comparisons, what kind of fix are you looking for?

  1. The more correct comparison with a float (i.e. just changing 0 to 0.0f)?
  2. Using an epsilon in the comparison?
  3. Using a boolean to keep track of the visibility, eliminating all floating point comparisons entirely?
puls commented 10 years ago

Probably the third one.

puls commented 10 years ago

This all looks good. You should update the docs before this is merged.

swiftal64 commented 10 years ago

I improved the support for UICollectionViews, and it now handles duplicate identifiers much better. The read me was also updated as you suggested.

jshier commented 9 years ago

@puls @oy65 This looks like exactly what my project needs. But is this project still going to be maintained? Any recommendations for similar tools?