Setup base project for ios(swift) development by following best practices. Aim to reuse in various projects. The purpose of using the boilerplate is to avoid redundant effort setup projects from scratch.
- Autocorrect/format code when build using SwiftFormat
- Lint test on build/Pull Request using SwiftLint
- Resource management using R.swift
- Dev/Staging/Production configurations
- File structure with MVC pattern
- Configure FontAwesome
- Unit/UI tests automation
- Distribute app by Fastlane
- Click Use this template or download the repo
- Open the project with an editor like VSCode or Sublime text. Replace keyword
SwiftBoilterplate
with your project name - Rename folder/file name (*1)
- Go to the root directory. Install packages by the command
pod install
- Open
{YOUR-PROJECT-NAME}.xcworkspace
. Then build the project (command + b). It will generate R.swift resource file. - Run the project (command + r)
(*1)
/SwiftBoilterplate -> /{YOUR-PROJECT-NAME}
/SwiftBoilterplateTests/SwiftBoilterplateTests.swift -> /{YOUR-PROJECT-NAME}Tests/{YOUR-PROJECT-NAME}Tests.swift
/SwiftBoilterplateUITests/SwiftBoilterplateUITests.swift -> /{YOUR-PROJECT-NAME}UITests/{YOUR-PROJECT-NAME}UITests.swift
.
├── Resources # images, fonts and colors
├── Classes
│ ├── routes # navigation, tabbar, sidemenu
│ ├── factories # reusable UI component factories
│ ├── services # networking, api communication
│ ├── models
│ ├── views # screens, view modules
│ ├── helpers
│ | ├── libs # libraries
│ | ├── utils # utilities
│ | └── exts # extensions
│ └── configs # configurations
└── Supporting Files # plist, formatter, lint config files
The default scheme is release
. Please create dev, staging scheme if you need
- Click
Edit Scheme
->Duplicate Scheme
- Update
Build Configuration
to Develop, Staging inRun
,Test
and others - After the scheme update, you will able to switch configuration. Variables can be set in
AppEnv.swift
This project is available under the MIT license. See the LICENSE file for more info.