Last active
June 4, 2020 07:27
-
-
Save MainasuK/6068ca66b58434115a0d9f2f1938d9d9 to your computer and use it in GitHub Desktop.
Xcode Code Snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
weak var context: AppContext! { willSet { precondition(!isViewLoaded) } } | |
weak var coordinator: SceneCoordinator! { willSet { precondition(!isViewLoaded) } } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final class <#TableViewCell#>: UITableViewCell { | |
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | |
super.init(style: style, reuseIdentifier: reuseIdentifier) | |
_init() | |
} | |
required init?(coder: NSCoder) { | |
super.init(coder: coder) | |
_init() | |
} | |
} | |
extension <#TableViewCell#> { | |
private func _init() { | |
<#code#> | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
final class <#ViewController#>: UIViewController { | |
} | |
extension <#ViewController#> { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
<#code#> | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#subview#>.translatesAutoresizingMaskIntoConstraints = false | |
addSubview(<#subview#>) | |
NSLayoutConstraint.activate([ | |
<#subview#>.topAnchor.constraint(equalTo: topAnchor), | |
<#subview#>.leadingAnchor.constraint(equalTo: leadingAnchor), | |
trailingAnchor.constraint(equalTo: <#subview#>.trailingAnchor), | |
bottomAnchor.constraint(equalTo: <#subview#>.bottomAnchor), | |
]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deinit { | |
os_log("%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment