Naming tips

Tips and tricks for naming things in Swift.

Use camelCase.

// Don't
var ViewController: UIViewController?

// Do
var viewController: UIViewController?

Do not shorten names.

// Don't
var vc: UIViewController

// Do
var viewController: UIViewController

Name things properly. If it is a LoginViewController – name it accordingly.

// Don't
var vc: UIViewController

// Do
var loginViewController: UIViewController

Leave a Comment