Skip to content

Commit 7c5c3e7

Browse files
author
Paolo Ardia
committed
Merge branch 'develop' of https://github.com/SysdataSpA/R.objc into develop
# Conflicts: # ResourceObjC.xcodeproj/project.pbxproj # ResourceObjC/Sources/StoryboardsGenerator.m # ResourceObjC/Sources/StringsGenerator.m
2 parents 61e92e7 + 0334f48 commit 7c5c3e7

6 files changed

Lines changed: 55 additions & 21 deletions

File tree

R.objc.podspec

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,22 @@
88

99
Pod::Spec.new do |s|
1010

11-
s.name = 'R.objc'
12-
s.version = '0.1.0'
13-
s.summary = 'Get autocompleted localizable strings and asset catalogue images names'
14-
s.description = <<-DESC
11+
s.name = 'R.objc'
12+
s.version = '0.2.0'
13+
s.summary = 'Get autocompleted localizable strings and asset catalogue images names'
14+
s.description = <<-DESC
1515
Freely inspired by R.swift: get autocompleted localizable strings and asset catalogue images names.
1616
You can have:
1717
- Compile time check: no more incorrect strings that make your app crash at runtime
1818
- Autocompletion: never have to guess that image name again
1919
DESC
2020

21-
s.homepage = 'https://github.com/SysdataSpA/R.objc'
22-
s.license = { :type => 'Apache License, Version 2.0', :file => 'LICENSE' }
23-
s.author = { 'Sysdata SpA' => 'team.mobile@sysdata.it' }
24-
s.source = { :http => 'https://github.com/SysdataSpA/R.objc/releases/download/0.1.0/robjc-0.1.0.zip' }
25-
s.preserve_paths = "robjc"
21+
s.homepage = 'https://github.com/SysdataSpA/R.objc'
22+
s.license = { :type => 'Apache License, Version 2.0', :file => 'LICENSE' }
23+
s.author = { 'Sysdata SpA' => 'team.mobile@sysdata.it' }
24+
s.source = { :http => 'https://github.com/SysdataSpA/R.objc/releases/download/0.2.0/robjc-0.2.0.zip' }
25+
s.preserve_paths = "robjc"
26+
s.ios.deployment_target = '8.0'
27+
s.tvos.deployment_target = '9.0'
28+
2629
end

R.objc_example.gif

2.42 MB
Loading

Readme.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
R.objc
22
======
33

4+
\<https://cocoapods.org/pods/R.objc https://cocoapods.org/pods/R.objc
5+
https://cocoapods.org/pods/R.objc\>
6+
47
Introduction
58
------------
69

710
Freely inspired by [R.swift](https://github.com/mac-cain13/R.swift) (Thank you,
8-
guys!): get autocompleted localizable strings and asset catalogue images names.
11+
guys!): get autocompleted localizable strings, asset catalogue images names and
12+
storyboard objects.
913

1014
You can have:
1115

@@ -20,6 +24,8 @@ Installation
2024
[CocoaPods](http://cocoapods.org/) is the recommended way of installation, as
2125
this avoids including any binary files into your project.
2226

27+
### Cocoapods
28+
2329
1. Add `pod 'R.objc'` to your [Podfile](http://cocoapods.org/#get_started) and
2430
run `pod install`
2531

@@ -29,14 +35,44 @@ this avoids including any binary files into your project.
2935
`New Run Script Phase` by clicking the little plus icon in the top left
3036

3137
4. Drag the new `Run Script` phase **above** the `Compile Sources` phase,
32-
expand it and paste the following script: `"${PODS_ROOT}/robjc" "$SRCROOT"`
38+
expand it and paste the following script: `"${PODS_ROOT}/Robjc" -p
39+
"$SRCROOT" `(after -p option, you have to specify the root folder of your
40+
project, from where to scan your code)
3341

3442
5. Build your project; in Finder you will now see `R.h` and `R.m` files in
3543
the `$SRCROOT` folder: drag them into your project and **uncheck** `Copy
3644
items if needed`
3745

3846
6. Repeat point 3 and 4 for every target in your project
3947

48+
### Manual
49+
50+
Since there are some problems with Cocoapods, you can manually install R.objc
51+
52+
1. Download latest version from the [releases
53+
section](https://github.com/SysdataSpA/R.objc/releases)
54+
55+
2. Unzip in a folder anywhere you want.
56+
57+
3. In XCode, click on your project in the Project Navigator
58+
59+
4. Choose your target under `TARGETS`, click the `Build Phases` tab and add
60+
`New Run Script Phase` by clicking the little plus icon in the top left
61+
62+
5. Drag the new `Run Script` phase **above** the `Compile Sources` phase,
63+
expand it and paste the following script: `"<path to the unzipped
64+
folder>/Robjc" -p "$SRCROOT"` (we suggest to unzip the folder somewhere
65+
within your project folder, in order to use the `$SRCROOT` shortcut for the
66+
path. **Don't add anything to your Xcode project, or it won't build
67+
anymore**) (after -p option, you have to specify the root folder of your
68+
project, from where to scan your code)
69+
70+
6. Build your project; in Finder you will now see `R.h` and `R.m` files in
71+
the `$SRCROOT` folder: drag them into your project and **uncheck** `Copy
72+
items if needed`
73+
74+
7. Repeat point 3 and 4 for every target in your project
75+
4076

4177

4278
At every build, the generated file will update automatically and there's no need

ResourceObjC.xcodeproj/project.pbxproj

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
06803EC91ED5EC630006208A /* StringsGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 06803EC81ED5EC630006208A /* StringsGenerator.m */; };
1818
06803ECD1ED5EDE20006208A /* BaseGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 06803ECC1ED5EDE20006208A /* BaseGenerator.m */; };
1919
AD8D6EDC1ED77538009CF948 /* FormattedStringParser.m in Sources */ = {isa = PBXBuildFile; fileRef = AD8D6EDB1ED77538009CF948 /* FormattedStringParser.m */; };
20+
AD928D521EDC04CD00F2FF35 /* LICENSE in CopyFiles */ = {isa = PBXBuildFile; fileRef = AD928D511EDC04CD00F2FF35 /* LICENSE */; };
2021
ADD731E01ED8C8A2006B0E51 /* ThemesGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = ADD731DF1ED8C8A2006B0E51 /* ThemesGenerator.m */; };
2122
ADDA17951ED6E40700AA0C51 /* Session.m in Sources */ = {isa = PBXBuildFile; fileRef = ADDA17941ED6E40700AA0C51 /* Session.m */; };
2223
ADDA17981ED6E75700AA0C51 /* CommonUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = ADDA17971ED6E75700AA0C51 /* CommonUtils.m */; };
@@ -29,18 +30,10 @@
2930
dstPath = "";
3031
dstSubfolderSpec = 7;
3132
files = (
33+
AD928D521EDC04CD00F2FF35 /* LICENSE in CopyFiles */,
3234
);
3335
runOnlyForDeploymentPostprocessing = 0;
3436
};
35-
06803EAB1ED5BDED0006208A /* CopyFiles */ = {
36-
isa = PBXCopyFilesBuildPhase;
37-
buildActionMask = 2147483647;
38-
dstPath = /usr/share/man/man1/;
39-
dstSubfolderSpec = 0;
40-
files = (
41-
);
42-
runOnlyForDeploymentPostprocessing = 1;
43-
};
4437
/* End PBXCopyFilesBuildPhase section */
4538

4639
/* Begin PBXFileReference section */
@@ -63,6 +56,7 @@
6356
06803ECC1ED5EDE20006208A /* BaseGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseGenerator.m; sourceTree = "<group>"; };
6457
AD8D6EDA1ED77538009CF948 /* FormattedStringParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormattedStringParser.h; sourceTree = "<group>"; };
6558
AD8D6EDB1ED77538009CF948 /* FormattedStringParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FormattedStringParser.m; sourceTree = "<group>"; };
59+
AD928D511EDC04CD00F2FF35 /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
6660
ADD731DE1ED8C8A2006B0E51 /* ThemesGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThemesGenerator.h; sourceTree = "<group>"; };
6761
ADD731DF1ED8C8A2006B0E51 /* ThemesGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ThemesGenerator.m; sourceTree = "<group>"; };
6862
ADDA17931ED6E40700AA0C51 /* Session.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Session.h; sourceTree = "<group>"; };
@@ -89,6 +83,7 @@
8983
06803EA41ED5BDED0006208A = {
9084
isa = PBXGroup;
9185
children = (
86+
AD928D511EDC04CD00F2FF35 /* LICENSE */,
9287
06803EAF1ED5BDEE0006208A /* ResourceObjC */,
9388
06803EAE1ED5BDED0006208A /* Products */,
9489
9DA791F98F13E3B29BB48D9C /* Pods */,
@@ -178,7 +173,6 @@
178173
E9072FBF0519547AF83D11C0 /* [CP] Check Pods Manifest.lock */,
179174
06803EA91ED5BDED0006208A /* Sources */,
180175
06803EAA1ED5BDED0006208A /* Frameworks */,
181-
06803EAB1ED5BDED0006208A /* CopyFiles */,
182176
06056E3A1ED6370900DFCF79 /* CopyFiles */,
183177
1D7FD1387FA1E9A2978866D5 /* [CP] Copy Pods Resources */,
184178
);

ResourceObjC/Sources/StoryboardsGenerator.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ - (void)mapStoryboards
9999
for (NSURL* url in urls)
100100
{
101101
NSString* name = [url.path.lastPathComponent stringByReplacingOccurrencesOfString:@".storyboard" withString:@""];
102+
name = [name stringByReplacingOccurrencesOfString:@" " withString:@""];
102103

103104
NSDictionary* storyboard = [NSDictionary dictionaryWithXMLFile:url.path];
104105

0 commit comments

Comments
 (0)