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
+36-39Lines changed: 36 additions & 39 deletions
Original file line number
Diff line number
Diff line change
@@ -6,40 +6,38 @@ Please follow along and you should create a template that is identical to the on
6
6
7
7
This recipe may also be useful for other scenarios, for example maybe you want to make a project that has the Example app using storyboards instead of SwiftUI.
8
8
9
-
10
9
## Ingredients
11
10
12
-
During the steps of this recipe we enter specific values where needed. These are chosen carefully so that the `./configure.rb` script can later find and replace these values in the template to create your project.
11
+
During the steps of this recipe we enter specific values where needed. These are chosen carefully so that the `./configure.swift` script can later find and replace these values in the template to create your project.
13
12
14
13
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.
15
14
16
-
-`xxPROJECTxNAMExx`
17
-
- This must be a valid C99 extended identifier (otherwise the Xcode check dependencies step fails). It cannot contain spaces.
18
-
- This must also be a Uniform Target Identifier (``/^[a-zA-Z0-9-.]+$/``).
19
-
- If this contains the characters `-` or `.` then they will be transliterated to `_` for file names.
15
+
-`xxPROJECTxNAMExx`
16
+
- This must be a valid C99 extended identifier (otherwise the Xcode check dependencies step fails). It cannot contain spaces.
17
+
- This must also be a Uniform Target Identifier (``/^[a-zA-Z0-9-.]+$/``).
18
+
- If this contains the characters `-` or `.` then they will be transliterated to `_` for file names.
20
19
21
-
-`__ORGANIZATION NAME__`
22
-
- This intentionally has a space which causes Xcode to use double quotes in its project configuration files.
23
-
24
-
-`com.AN.ORGANIZATION.IDENTIFIER`
20
+
-`__ORGANIZATION NAME__`
21
+
- This intentionally has a space which causes Xcode to use double quotes in its project configuration files.
25
22
26
-
-`__AUTHOR NAME__`
27
-
- This intentionally has a space which causes Xcode to use double quotes in its project configuration files.
23
+
-`com.AN.ORGANIZATION.IDENTIFIER`
28
24
29
-
-`__TODAYS_DATE__`
25
+
-`__AUTHOR NAME__`
26
+
- This intentionally has a space which causes Xcode to use double quotes in its project configuration files.
30
27
31
-
-`__TODAYS_YEAR__`
28
+
-`__TODAYS_DATE__`
32
29
33
-
-`__GITHUB_USERNAME__`
30
+
-`__TODAYS_YEAR__`
34
31
32
+
-`__GITHUB_USERNAME__`
35
33
36
34
## Steps
37
35
38
36
Complete all these instructions on the same calendar day.
39
37
40
-
Use Xcode Version 16.0 (16A242d). *This is the latest publicly released or Gold Master version.*
38
+
Use Xcode version 16.3 (16E140). *This is the latest publicly released or Gold Master version.*
41
39
42
-
A previous version of this recipe is also demonstrated in a YouTube flyover at https://youtu.be/ksYXtNn8lhE (15 minutes).
40
+
A previous version of this recipe is also demonstrated in a YouTube flyover at <https://youtu.be/ksYXtNn8lhE> (15 minutes).
43
41
44
42
### I. Create a package for your module
45
43
@@ -51,7 +49,6 @@ A previous version of this recipe is also demonstrated in a YouTube flyover at h
51
49
5. Ensure "Create Git repository on my Mac" is unchecked
52
50
6. Click “Create"
53
51
54
-
55
52
### II. Add some functionality to the module
56
53
57
54
1. Use Terminal.app to insert some files into the project
@@ -73,9 +70,10 @@ A previous version of this recipe is also demonstrated in a YouTube flyover at h
73
70
3. Set Organization Identifier to `com.AN.ORGANIZATION.IDENTIFIER`
74
71
4. Set User Interface to "SwiftUI"
75
72
5. Set Language to "Swift"
76
-
6. Set Storage to "None"
77
-
7. Ensure "Include Tests" is not selected
78
-
8. Click “Next"
73
+
6. Set Testing System to "Swift Testing with XCTest UI Tests"
74
+
7. Set Storage to "None"
75
+
8. Ensure "Host in CloudKit" is not selected
76
+
9. Click “Next"
79
77
3.*Create the project*
80
78
1. Ensure “Create Git Repository on my Mac" is not selected
81
79
2. Ensure "Add to" is “Don’t add to any project or workspace"
@@ -85,17 +83,17 @@ A previous version of this recipe is also demonstrated in a YouTube flyover at h
85
83
### IV. Use the directory layout structure like Alamofire
86
84
87
85
1.*Move Example source code to a folder named "Sources"*
88
-
1. Open the file Example.xcodeproj in Xcode
86
+
: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/swiftlang/swift-package-manager/blob/451196234d81f82a147293105fd4467cdd69b6ac/Sources/Workspace/InitPackage.swift#L570C48-L570C50).
87
+
88
+
1. Open the file Example.xcodeproj in Xcode (it's on your desktop, in the xxPROJECTxNAMExx > Example folder)
89
+
90
+
:information_source: You will see "Cannot preview in this file", but we resolve this in the step "Make your Example application depend on your module" below.
91
+
89
92
2. Show the Project navigator on the left (folder icon)
93
+
90
94
3. Use the Project navigator to select the "Example" folder (blue icon)
95
+
91
96
4. From the Project navigator, rename this folder as "Sources"
92
-
*: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/swiftlang/swift-package-manager/blob/dd22b6ef16315fcdcb07c1f86bd608598f102e20/Sources/Workspace/InitPackage.swift#L566)
93
-
2.*Fix the Info.plist file configuration and preview content folder (Xcode makes renaming folders a pain)*
94
-
1. Click "Example" on the left (the blue app icon)
95
-
2. In the middle area, click the target "Example" (gray app icon)
96
-
3. Click "Build Settings" on the top of the middle
97
-
6. Enter "Development Assets" in the search box
98
-
7. In the "Deployment" section, edit the value from “Example/Preview Content” to "Sources/Preview Content"
99
97
100
98
### V. Add some functionality to your Example application
101
99
@@ -109,12 +107,12 @@ A previous version of this recipe is also demonstrated in a YouTube flyover at h
109
107
### VI. Make your Example application depend on your module
110
108
111
109
1. Open Example.xcodeproj in Xcode
112
-
3. In Xcode, choose File > Add Package Dependencies...
110
+
2. In Xcode, choose File > Add Package Dependencies...
113
111
1. Click "Add Local..."
114
-
2. Select the `xxPROJECTxNAMExx`folder on your desktop
112
+
2. Select the folder `xxPROJECTxNAMExx` on the desktop (don't double click it)
115
113
3. Click "Add Package"
116
114
4. In the choose package products, set the "add to target" to "Example", and click "Add Package"
0 commit comments