You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Xcode 5 has an awesome new feature called "[asset catalogs](https://developer.ap
12
12
13
13
Unfortunately, to get the full benefits, you have to set your deployment target to iOS 7; otherwise, Xcode will dutifully put all of the images into your app bundle but totally ignore all of your resizable insets with only a build warning.
14
14
15
-
And even if you're targeting iOS 7, you'll still have to deal with typing string filenames correctly. And[everybody knows that stringly-typed code is bad.](http://c2.com/cgi/wiki?StringlyTyped)
15
+
And even if you're targeting iOS 7, you'll still have to deal with typing string filenames correctly. And[everybody knows that stringly-typed code is bad.](http://c2.com/cgi/wiki?StringlyTyped) (While you're at it, consider replacing your stringly-typed key paths with[a macro to check them at compile time!](https://gist.github.com/kyleve/8213806))
16
16
17
17
But shucks! The important and awesome part is the editor, and it puts all of the data out in super-readable JSON. We should be able to do a poor man's version that reads in the data and spits out some code to give you most of the benefits.
18
18
@@ -48,13 +48,13 @@ At least I think so. But if you go and search for more information on storyboard
We already fixed the part about code reuse with`objc-colordump`, and now we can fix the parts about failures at runtime. If we generate some code to turn your string identifiersinto compiler-checked constants, we can avoid a whole class of problems.
51
+
We already fixed the part about code reuse with`objc-colordump`, and now we can fix the parts about failures at runtime. If we generate some code to turn your string identifiers—and that's any kind of string identifier, be it a view controller identifier, a segue identifier, or a cell reuse identifier—into compiler-checked constants, we can avoid a whole class of problems.
52
52
53
53
###Usage
54
54
55
55
Call`objc-identifierconstants` with the`.storyboard` paths as arguments from the directory into which it should output the code.
56
56
57
-
For a storyboard named "Foo" withstring identifiers"Bar" and "Baz" somewhere in it, you'll get`FooStoryboardIdenfitiers.h` and`FooStoryboardIdentifiers.m` with`extern NSString *const FooStoryboardBarIdentifier` and`extern NSString *const FooStoryboardBazIdentifier` in it. Put them in your DerivedSources folder and you're good to go.
57
+
For a storyboard named "Foo" withview controller identifier"Bar" and segue identifier "Baz" somewhere in it, you'll get`FooStoryboardIdenfitiers.h` and`FooStoryboardIdentifiers.m` with`extern NSString *const FooStoryboardBarIdentifier` and`extern NSString *const FooStoryboardBazIdentifier` in it. Put them in your DerivedSources folder and you're good to go.
58
58
59
59
##Command-line options (common to all three tools)