Last active
April 18, 2019 16:16
-
-
Save yoxisem544/e12e1a9dc4454c68c6c739588720fdf6 to your computer and use it in GitHub Desktop.
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
// UIViewController | |
import UIKit | |
final public class <#AnyViewController#>: UIViewController { | |
// MARK: - π Constants | |
// MARK: - πΆ Properties | |
// MARK: - π¨ Style | |
// MARK: - π§© Subviews | |
// MARK: - π Actions | |
// MARK: - π¨ Initialization | |
public init() { | |
super.init(nibName: nil, bundle: nil) | |
} | |
required public init?(coder aDecoder: NSCoder) { | |
fatalError("init(coder:) has not been implemented") | |
} | |
// MARK: - πΌ View Lifecycle | |
public override func viewDidLoad() { | |
super.viewDidLoad() | |
seutpUI() | |
} | |
public override func viewWillLayoutSubviews() { | |
super.viewWillLayoutSubviews() | |
// resize when frame has changed... | |
} | |
// MARK: - π UI | |
private func seutpUI() { | |
} | |
// MARK: - π Public Methods | |
// MARK: - π Private Methods | |
} | |
// MARK: - π§Ά Extensions | |
// UIView | |
import UIKit | |
final public class <#AnyView#>: UIView { | |
// MARK: - π Constants | |
// MARK: - πΆ Properties | |
// MARK: - π¨ Style | |
// MARK: - π§© Subviews | |
// MARK: - π Actions | |
// MARK: - π¨ Initialization | |
public convenience init() { | |
self.init(frame: .zero) | |
} | |
private override init(frame: CGRect) { | |
super.init(frame: frame) | |
setupUI() | |
} | |
required public init?(coder aDecoder: NSCoder) { | |
fatalError("init(coder:) has not been implemented") | |
} | |
// MARK: - π UI | |
private func setupUI() { | |
} | |
// MARK: - π Public Methods | |
// MARK: - π Private Methods | |
} | |
// MARK: - π§Ά Extensions | |
// UICollectionViewCell | |
import UIKit | |
final public class <#AnyCell#>: UICollectionViewCell { | |
// MARK: - π Constants | |
// MARK: - πΆ Properties | |
// MARK: - π¨ Style | |
// MARK: - π§© Subviews | |
// MARK: - π Actions | |
// MARK: - π¨ Initialization | |
public override init(frame: CGRect) { | |
super.init(frame: frame) | |
setupUI() | |
} | |
required public init?(coder aDecoder: NSCoder) { | |
fatalError("init(coder:) has not been implemented") | |
} | |
// MARK: - π UI | |
private func setupUI() { | |
} | |
// MARK: - π Public Methods | |
// MARK: - π Private Methods | |
} | |
// MARK: - π§Ά Extensions | |
// Static let CGFloat | |
static let <#Any#>: CGFloat = <#Value#> | |
// static let font | |
static let font = UIFont(name: "<#T##String#>", size: <#T##CGFloat#>)! | |
// static let text color | |
static let textColor = "#<#color#>".color | |
// configure | |
private func configure<#Something#>() { | |
} | |
// Setup ui | |
private func setupUI() { | |
} | |
// Extend self life | |
guard let `self` = self else { return } | |
// View can bind ViewModel | |
// ViewModel Type | |
// Decodable | |
public struct <#DecodableModel#>: Decodable { | |
enum CodingKeys: String, CodingKey { | |
<#Add some cases...#> | |
} | |
public init(from decoder: Decoder) throws { | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
<#Decode your model...#> | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment