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: Recipe.md
+34-52Lines changed: 34 additions & 52 deletions
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,11 @@ This recipe may also be useful for other scenarios, for example maybe you want t
9
9
10
10
During the steps of this recipe we enter specific values where needed. These are chosen carefully so that the `./configure` script can later find and replace these values in the template to create your project.
11
11
12
-
Some variables have spaces in them. That is intentional because it causes Xcode to use double quotes around them in its project configuration files.
12
+
Some variables have spaces in them. That is intentional because Xcode only uses robust quoting in its project configuration files (which we want) if the variables have spaces in them.
13
13
14
14
-`xxPROJECTxNAMExx`
15
15
- This must be a valid C99 extended identifier (otherwise the Xcode check dependencies step fails). It cannot contain spaces.
16
-
- This must also be a Uniform Target Identifier (/^[a-zA-Z0-9-.]+$/).
16
+
- This must also be a Uniform Target Identifier (``/^[a-zA-Z0-9-.]+$/``).
17
17
- If this contains the characters `-` or `.` then they will be transliterated to `_` for file names.
18
18
19
19
-`__ORGANIZATION NAME__`
@@ -35,13 +35,13 @@ Some variables have spaces in them. That is intentional because it causes Xcode
35
35
36
36
Complete all these instructions on the same calendar day.
37
37
38
-
Use Xcode Version 12.4 (12D4e). *This is the latest publicly released or Gold Master version.*
38
+
Use Xcode Version 13.1 (13A1030d). *This is the latest publicly released or Gold Master version.*
39
39
40
40
This recipe is also demonstrated in a YouTube flyover at https://youtu.be/ksYXtNn8lhE (15 minutes).
41
41
42
42
### I. Create a package for your module
43
43
44
-
1. In Xcode, choose File > New > Swift Package…
44
+
1. In Xcode, choose File > New > Package…
45
45
1. Navigate to your Desktop folder
46
46
2. Type the name `xxPROJECTxNAMExx`
47
47
3. Ensure "Create Git repository on my Mac" is unchecked
@@ -68,11 +68,10 @@ This recipe is also demonstrated in a YouTube flyover at https://youtu.be/ksYXtN
68
68
69
69
2.*Set the project options*
70
70
1. Set Product Name to "iOS Example"
71
-
2. Set Team to "NONE"
71
+
2. Set Team to "None"
72
72
3. Set Organization Identifier to `com.AN.ORGANIZATION.IDENTIFIER`
73
73
4. Set User Interface to "SwiftUI"
74
-
5. Set Life Cycle to "SwiftUI App"
75
-
6. Set Language to "Swift"
74
+
5. Set Language to "Swift"
76
75
7. Ensure “Use Core Data” and "Include Tests" are not selected
77
76
8. Click “Next"
78
77
3.*Create the project*
@@ -85,18 +84,16 @@ This recipe is also demonstrated in a YouTube flyover at https://youtu.be/ksYXtN
85
84
86
85
1.*Move iOS Example source code to a folder named "Sources"*
87
86
1. Open the file iOS Example.xcodeproj in Xcode
88
-
2.Enable the Project navigator on the left (folder icon)
89
-
3. Use the Project navigator to select the "iOS Example" folder (yellow icon)
87
+
2.Show the Project navigator on the left (folder icon)
88
+
3. Use the Project navigator to select the "iOS Example" folder (gray icon)
90
89
4. From the Project navigator, rename this folder as "Sources"
91
-
*:information_source: The Alamofire project uses [the folder name "Source"](https://github.com/Alamofire/Alamofire/tree/master/Example/Source) but we choose "Sources" here to be consistent with [the default of Swift Package Manager](https://github.com/apple/swift-package-manager/blob/b1a6f45aa9daed0c8a609d34af8f71cf4282ddd4/Sources/Workspace/InitPackage.swift#L256)
90
+
*:information_source: The Alamofire project uses [the folder name "Source"](https://github.com/Alamofire/Alamofire/tree/master/Example/Source) but we choose "Sources" here to be consistent with [the default of Swift Package Manager](https://github.com/apple/swift-package-manager/blob/4fd4df4275627ebc91a0f288c38658738cd9fa0f/Sources/Workspace/InitPackage.swift#L275)
92
91
2.*Fix the Info.plist file configuration and preview content folder (Xcode makes renaming folders a pain)*
93
92
1. Click "iOS Example" on the left (the blue icon)
94
93
2. Click the target "iOS Example" in the middle (white app icon)
95
94
3. Click "Build Settings" on the top of the middle
96
-
4. Enter "/Info" in the search box
97
-
5. Edit the "Info.plist File" from "iOS Example/Info.plist" to be "Sources/Info.plist”
98
95
6. Enter "Development Assets" in the search box
99
-
7.Edit the value from “iOS Example/Preview Content” to "Sources/Preview Content"
96
+
7.In the "Deployment" section, edit the value from “iOS Example/Preview Content” to "Sources/Preview Content"
100
97
101
98
### V. Add some functionality to your iOS Example application
102
99
@@ -110,28 +107,20 @@ This recipe is also demonstrated in a YouTube flyover at https://youtu.be/ksYXtN
110
107
### VI. Make your iOS Example application depend on your module
111
108
112
109
1. Open iOS Example.xcodeproj in Xcode
110
+
2. In Xcode, choose File > Add Packages...
111
+
1. Click "Add Local..."
112
+
2. Select the `xxPROJECTxNAMExx` folder on your desktop
113
+
3. Click "Add Package"
113
114
114
-
3. Drag the `xxPROJECTxNAMExx` folder on your desktop into the Xcode Project navigator at the bottom, be sure it is subordinated under iOS Example
1. At the dialog "Do you want to save this project in a new workspace?" click "Save"
120
-
2. Navigate inside the iOS Example folder, in the `xxPROJECTxNAMExx` folder on your desktop
121
-
3. Set the name as "iOS Example"
122
-
4. Click Save
123
-
- ⚠️ Xcode will also show the iOS Example folder inside the `xxPROJECTxNAMExx` module. Swift packages are unable to specify excluded files. You can safely ignore that folder.
124
-
-:warning: Xcode has an error where this added dependency will show as ".." instead of the correct name. This discrepency can be safely ignored and it will show correctly the next time you open "iOS Example.xcworkspace".
125
-
126
-
4.*Add a build dependency*
127
-
128
-
1. Click "iOS Example" on the left (the blue icon) at the top-level (not subordinated to the `xxPROJECTxNAMExx` module)
129
-
2. Click the target "iOS Example" in the middle (white app icon)
130
-
3. Click "Build Phases" on the top
131
-
4. Open the section Link Binary With Libraries
132
-
5. Click the plus (+) button
133
-
6. Select `xxPROJECTxNAMExx` (the building icon)
134
-
7. Click "Add"
115
+
3.*Add a build dependency*
116
+
1.:information_source: You may or may not need to quit and reopen Xcode to proceed and see the required library, this is a known Xcode issue
117
+
1. Click "iOS Example" on the left (the blue icon)
118
+
1. Click the target "iOS Example" in the middle (white app icon)
119
+
1. Click "Build Phases" on the top
120
+
1. Open the section Link Binary With Libraries
121
+
1. Click the plus (+) button
122
+
1. Select `xxPROJECTxNAMExx` (the building icon)
123
+
1. Click "Add"
135
124
136
125
### VII. Add additional project management files to the module
137
126
@@ -141,14 +130,15 @@ This recipe is also demonstrated in a YouTube flyover at https://youtu.be/ksYXtN
0 commit comments