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
This is a template project for boostrapping iOS applications
6
6
7
7
## Prequisites
8
8
9
-
Install [cookiecutter](https://cookiecutter.readthedocs.io/en/latest/index.html),[XcodeGen](https://github.com/yonaskolb/XcodeGen) and [Mint](https://github.com/yonaskolb/Mint) in order to create a new project from this template:
9
+
Install [cookiecutter](https://cookiecutter.readthedocs.io/en/latest/index.html),[tuist](https://github.com/tuist/tuist) and [Mint](https://github.com/yonaskolb/Mint) in order to create a new project from this template:
-[LoggingKit](https://github.com/alexanderwe/LoggingKit) - A small micro-framework for logging
38
38
- Code Style
39
-
-[SwiftLint](https://www.github.com/realm/SwiftLint) - Common linting rules
40
-
- Helpers
41
-
-[Rswift](https://github.com/mac-cain13/R.swift) - Type safe access to string resources
39
+
-[swiftformat](https://github.com/nicklockwood/SwiftFormat) - Format and lint your source code
40
+
42
41
43
42
## Structure
44
43
45
-
The structure of the template project tries to follow the idea in [this article](https://theswiftdev.com/2016/07/06/conventions-for-xcode/) from `The.Swift.Dev`
44
+
The structure of the template project tries to follow the idea of having a directory for each of your target. In each of these targets you can find it sources and the corresponding tests.
46
45
47
46
External dependencies are managed via `Swift Package Manager`. Therefore it is mandatory to use **Xcode 11**.
48
47
49
48
### External build tools
50
49
51
-
External build tools like `swiftlint` and `R.swift`are managed by `Mint` This is necessary because the `Swift Package Manager` is not handling binaries, and therefore `Mint` is doing this job for us.
50
+
External build tools like `swiftformat`are managed by `Mint`.
52
51
53
52
### Modules
54
53
55
54
The project is divided into several modules:
56
55
57
-
-`iOSApplication` - Contains UI code, navigation flows, views if used for SwiftUI or view controllers when UIKit is used
58
-
-`iOSApplicationTests` - Unit tests for the iOS application
59
-
-`iOSApplicationUITests` - UI tests for the iOS application
56
+
-`iOS` - Contains UI code, navigation flows, views if used for SwiftUI or view controllers when UIKit is used
57
+
-`Tests iOS` - Unit tests for the iOS application
58
+
-`UI Tests iOS` - UI tests for the iOS application
60
59
-`<ProjectName>Kit` - Source files for your service layer or generally speaking files that could be reused for example for an macOS or watchOS target
61
-
-`<ProjectName>KitTests` - Unit test for the `<ProjectName>Kit` target
60
+
-`<ProjectName>Kit Tests` - Unit test for the `<ProjectName>Kit` target
62
61
63
62
### Schemes
64
63
65
-
In general each target has its own scheme but the `iOSApplication` target has three:
64
+
In general each target has its own scheme but the `iOS` target has three:
66
65
67
66
- development
68
67
- staging
69
68
- production
70
69
71
-
Each scheme is used in combination with the files located in `iOSApplication/SupportingFiles/Config`. There you can find four different files. Three for each scheme and one which contains the values for the active configuration. Each scheme has a `pre-build` action which copies the content from one of "release type" configs to `Configuration.xcconfig` which is then used when the app is running.
70
+
Each scheme is used in combination with the files located in `Targets/iOS/SupportingFiles/Config`. There you can find four different files. Three for each scheme and one which contains the values for the active configuration. Each scheme has a `pre-build` action which copies the content from one of "release type" configs to `Configuration.xcconfig` which is then used when the app is running.
72
71
73
72
So for example if you are running the `iOS Applcation staging` scheme, the content of the `Staging.xcconfig` file is copied over to `Configuration.xcconfig` and can then be used within the app.
74
73
75
74
Currently this mechanism is used to change the app identifier and set some environment variable. This can be extended to for example use different backend urls for different schemes.
76
75
77
-
If you want to access one of the variables you declare inside the `.xcconfig` files you need to make them accessible to the app by putting them into the `iOSApplication/Sources/SupportingFiles/Info.plist` file. As an example you can have a look at the `_ServerEnvironment` variable which is later accessed within the `ViewController`.
76
+
If you want to access one of the variables you declare inside the `.xcconfig` files you need to make them accessible to the app by putting them into the `Derived/InfoPlists/<Info.plist file for iOS target>` file. As an example you can have a look at the `_ServerEnvironment` variable which is later accessed within the `ViewController`.
78
77
79
78
#### External configuration files
80
79
@@ -88,7 +87,7 @@ The mechanism described above can also be used for external configuration files.
88
87
Inside the `pre-build` actions for the different schemes you copy the content of the corresponding file to `GoogleService-Info.plist` which is then used by your Google frameworks in the app. Such an `pre-build` command could like like the following.
--disable indent #Rationale: Until decided, too many false positives
15
+
--disable redundantType #Rationale: Sometimes it makes the code easier to understand to explicitly declare the type, even if its obvious for the compiler
16
+
--disable redundantReturn #Rationale: Omitting the `return` keyword is a new feature in Swift 5.3. It could be confusing for new developers to omit it
0 commit comments