-
Notifications
You must be signed in to change notification settings - Fork 0
Coding Guidlines
Alexandru Turcanu edited this page Dec 17, 2018
·
9 revisions
-
naming constants with
kf
as a prefix -
name new classes with the following as a prefix:views withKFV
models withKFM
view-model withKFVM
view controllers withKFC
protocols withKFP
-
add constants to an extension that is similar to its type:
extension UIColor {
static let kfPrimaryColor = UIColor(...)
}
- if the constraint is specific to a class file or view controller, like a segue:
extension UIStoryboardSegue {
static let showDetailedDonation = “showDetailedDonation”
}
- use the following in all classes larger than 50 lines of code (view here for some more details):
class MyClass {
// MARK: - Variables
// MARK: - Initializers
// MARK: - Lifecycle
// MARK: - Methods
}
// MARK: - UITableViewDataSource
extension MyClass: UITableViewDataSource {
...
}