Inits override for UIView with a setup method
Keyword: setupview
Snippet code
// MARK: - Life cycle
override init(frame: CGRect) {
super.init(frame: frame)
setup()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
setup()
}
// MARK: - Private
private func setup() {
<#code#>
}A guard to get a strong self
Keyword: gself
Snippet code
guard let self = self else { return }A section indicator comment
Keyword: m
Snippet code
// MARK: - <#comment#>A private function
Keyword: pfunc
Snippet code
private func <#funcName#>() {
<#code#>
}The verbose code to pin a view with autolayout
Snippet code
<#SubView#>.translatesAutoresizingMaskIntoConstraints = false
<#SubView#>.topAnchor.constraint(equalTo: <#SubViewContainerView#>.topAnchor).isActive = true
<#SubView#>.bottomAnchor.constraint(equalTo: <#SubViewContainerView#>.bottomAnchor).isActive = true
<#SubView#>.leadingAnchor.constraint(equalTo: <#SubViewContainerView#>.leadingAnchor).isActive = true
<#SubView#>.trailingAnchor.constraint(equalTo: <#SubViewContainerView#>.trailingAnchor).isActive = trueA private indicator comment
Keyword: mp
Snippet code
// MARK: - PrivateA comment to disable locally swiftlint rules
Keyword: swiftlint
Snippet code
// swiftlint:disable:<#this/next#> <#disabled_warning#>A public indicator comment
Keyword: mpu
Snippet code
// MARK: - PublicA constants enum snippet following Fabernovel coding style
Keyword: cst
Snippet code
private enum Constants {
static let <#constantName#>: <#constantType#> = <#constantValue#>
}A private constant
Keyword: plet
Snippet code
private let <#name#> = <#value#>A private variable
Keyword: pvar
Snippet code
private var <#variable#>: <#Type#>