- Using uppercase for types and protocols, lowercase for everything else [1].
- Using camel case.
- Indentation : Indent using 2 spaces rather than tabs to conserve space and help prevent line wrapping.[1]
- Keep imports minimal. For example, don't import UIKit when importing Foundation will suffice.[1]
- Auto Indentation in Xcode: Control + I
- When coding, hold Option button, direct to the Swift API documentation
-
For example, you have created a single app application in XCode. => Then you should group some auto provided files such as AppDelegate.swift, LaunchScreen.storyboard, info.plist into SupportingFiles (See image):
=> Also, you need to change the generic ViewController to a more Specific name. -
If you adopt MVC structure(highly recommended), make sure your project contains Model, View, Controller folder respectively.(See image):