Skip to content

Commit 55cd36f

Browse files
theme section open to everyone
1 parent a651ffc commit 55cd36f

2 files changed

Lines changed: 37 additions & 19 deletions

File tree

R.objc/Sources/Session.m

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,7 @@ - (NSURL *)baseURL
209209

210210
- (ResourceType)resourcesToGenerate
211211
{
212-
ResourceType result = ResourceTypeStrings | ResourceTypeImages | ResourceTypeStoryboards | ResourceTypeSegues;
213-
if (self.isSysdataVersion)
214-
{
215-
result = result | ResourceTypeThemes;
216-
}
212+
ResourceType result = ResourceTypeStrings | ResourceTypeImages | ResourceTypeStoryboards | ResourceTypeSegues | ResourceTypeThemes;
217213
return result;
218214
}
219215

Readme.md

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,6 @@ this avoids including any binary files into your project.
8383
8484
7. Repeat point 3 and 4 for every target in your project
8585
86-
Options available to invoke the script:
87-
88-
- `-p` (or --path): path to the root of the project or from where you want the
89-
scan to begin
90-
91-
- `-e` (or --excluded): excluded dir path; all dirs within this path will be
92-
excluded; you can use `-e` option more than once
93-
94-
- `-v` (or `--verbose`): verbose logging
9586
9687
 
9788
@@ -114,6 +105,31 @@ self.welcomeLabel.text = [R.string.localizable homeTitleWelcome:@"John"];
114105
self.radioButtonImageView.image = selected ? R.image.checkedRadioButton : R.image.uncheckedRadioButton;
115106
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
116107
108+
### Available command line options
109+
110+
You can add these options to customize R.objc behaviour:
111+
112+
- `-p` (or `--path`): **MANDATORY** path to the root of the project or from where you want the scan to begin
113+
114+
- `-e` (or `--excluded`): excluded dir path; all dirs within this path will be excluded; you can use `-e` option more than once
115+
116+
- `-v` (or `--verbose`): verbose logging
117+
118+
- `-s` (or `--sysdata`): for internal use only
119+
120+
- `-r` (or `--refactor`): R.objc will replace all occurrences of NSLocalizedString with the correct `R.string` reference
121+
122+
- `--skip-strings`: jump the strings step
123+
124+
- `--skip-images`: jump the images step
125+
126+
- `--skip-themes`: jump the themes step
127+
128+
- `--skip-storyboards`: jump the storyboards step
129+
130+
- `--skip-segues`: jump the segues step
131+
132+
117133
What can you do?
118134
----------------
119135
@@ -154,11 +170,6 @@ R.image.navbarLogo
154170
155171
You'll get a `UIImage*` directly.
156172
157-
### Themes
158-
159-
This part is just for internal use, maybe one day we'll publish out theme
160-
manager.
161-
162173
### Storyboards
163174
164175
All storyboards in the bundle will be mapped in a
@@ -187,6 +198,17 @@ R.segue.myViewController.goToNextSegue.identifier // identifier of the segue
187198
[R.segue.myViewController.goToNextSegue.identifier performWithSource:self sender:userInfo]; // perform segue
188199
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
189200
201+
### Themes
202+
203+
If you are using [Giotto Theme Manager](https://github.com/SysdataSpA/Giotto), R.objc will search for theme_*.plist files in your project. You can then access to all your constants and styles.
204+
205+
Example:
206+
207+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
208+
[R.theme.styles.myStyle applyTo:self]; // apply the style MyStyle to object self
209+
R.theme.constants.COLOR_TEXT_LIGHT // reference to a constant in the theme
210+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
211+
190212
 
191213
192214
Contribute

0 commit comments

Comments
 (0)