Structuring a project.
WHAT A TARGET PRODUCES
One build product: an application, a framework, an extension, a test bundle.
WHAT TO SEPARATE INTO TARGETS
Extensions, which are separate executables Shared code, as a framework or package Tests
WHAT BUILD SETTINGS CONTROL
Almost everything about compilation and packaging.
WHERE THEY CAN BE SET
At project level, target level, and through configuration files.
WHAT TO PREFER
Configuration files, held in version control.
WHY
Settings buried in the project file are hard to review and cause conflicts.
WHAT CAUSES MERGE CONFLICTS
The project file, which is a single file every change touches.
WHAT REDUCES THEM
Moving settings into configuration files Using package-based dependencies Smaller, more frequent changes
WHAT TO KEEP CONSISTENT
The deployment target across targets Swift language version Signing configuration
WHAT TO AVOID
Hard-coded paths Settings that differ between developers' machines Manual steps required to build
WHAT TO VERIFY
That a clean checkout builds without manual intervention.