New iOS Project
Kip Landergren
(Updated: )
My checklist flow for creating a new iOS 13 project using Xcode, SwiftLint, and git.
Contents#
Purpose#
Consistent creation of iOS projects.
Preconditions#
Valid Name#
Convention is to use CamelCase. SwiftLint will throw warnings unless rule is excluded.
Steps#
Basics#
- File -> New -> Project
- Select Single View App (or appropriate type)
- Add ProjectName
- Select Language: Swift
- Select User Interface: Storyboard
- Check appropriate boxes for Core Data / tests
- Select parent directory. Note: Xcode will create a directory ProjectName within the selected parent directory.
- Do not check box to initialize git repository. Handle separately.
(Optional) Remove Storyboard#
- Focus Info.plist in Project Navigator
- Remove key
UISceneStoryboardFile:- Expand:
- Information Property List
- Application Scene Manifest
- Scene Configuration
- Application Session Role
- Item 0
- Application Session Role
- Scene Configuration
- Application Scene Manifest
- Information Property List
- Delete entry Storyboard Name
- Expand:
- Remove key
UIMainStoryboardFile:- Expand:
- Information Property List
- Delete entry Main storyboard file base name
- Expand:
- Delete Main.storyboard
- Create
UIViewControllernamed MainViewController.swift - Update SceneDelegate.swift with sample code below
- Clean and Build
Sample SceneDelegate.swift function code:
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
if let windowScene = scene as? UIWindowScene {
window = UIWindow(windowScene: windowScene)
window?.rootViewController = MainViewController()
window?.makeKeyAndVisible()
}
}
(Optional) Add SwiftLint#
Refer to instructions in the Xcode Integration section of the SwiftLint Reference.
On Completion#
- git repository is created
- git repository remote on GitHub