Project structure - Faifly/xDrip GitHub Wiki
Project structure
Xcode project
The project consists of a single Xcode project xDrip
without a workspace. The project itself has 2 targets: xDrip
(main application) and xDripTests
(unit tests).
Project settings
Supported platforms:
- iOS.
- iPadOS.
- macOS (Catalyst).
Deployment target:
- 11.0 for iOS.
- 11.0 for iPadOS.
- 10.15 for macOS.
Supported interface orientations:
- iPhone: portrait only.
- iPad: portrait & landscape.
Third-party dependency management
Third-party dependencies are managed by Swift Package Manager. If any dependencies are not available via SPM, they are added manually.
Project folder structure
The project consists of 3 folder:
xDrip
(application logic).xDripTests
(unit tests).Frameworks
(manually added frameworks).
xDripTests
folders and files should completely reflect the xDrip
folder, because unit tests are created for each .swift
file separately.
xDrip
folder structure:
Scenes
. Here lies the main UI structure of the application, where each scene is a Clean Swift scene.Services
. Networking, database and sensors communication logic.Model
. Database entities and other general models.Controllers
. Specific logic controllers, e.g.ApplicationLaunchController
orDatabaseController
.Components
. Reused atomic UI components.Extensions
. Different system classes extensions.ApplicationSupport
.Info.plist
,AppDelegate
, CI configuration, entitlements etc.Resources
. Images, colors, localization.
Resources
Images
All the images are located in Assets.xcassets
, grouped by subfolders. There are different images defined for dark theme and light theme.
Colors
All the colors are created as named colors in Assets.xcassets
in Colors
subfolder. This is the only source of colors in the application. They are different for light and dark themes.
Localization
Localization is automated with a node.js
script (see localization/update_localization.js
. During build time it automatically parses contents of a Google spreadsheet to a set of Localizable.strings
. If you need to add some localization, please contact us.