File tree Expand file tree Collapse file tree
src/Projects/BKDesign/PreviewApp/Sources/Common Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // Copyright © 2025 Booket. All rights reserved
2+
3+ import UIKit
4+
5+ class BaseView : UIView {
6+ // MARK: - Initialize
7+ override init ( frame: CGRect = . zero) {
8+ super. init ( frame: frame)
9+ self . setupView ( )
10+ self . setupLayout ( )
11+ self . configure ( )
12+ }
13+
14+ @available ( * , unavailable)
15+ required init ? ( coder: NSCoder ) {
16+ fatalError ( " init(coder:) has not been implemented " )
17+ }
18+
19+ // MARK: - Common Methods
20+ func setupView( ) { }
21+ func setupLayout( ) { }
22+ func configure( ) { }
23+ }
Original file line number Diff line number Diff line change 1+ // Copyright © 2025 Booket. All rights reserved
2+
3+ import UIKit
4+
5+ class BaseViewController < T: BaseView > : UIViewController {
6+ // MARK: - Properties
7+ let contentView : T
8+
9+ // MARK: - Initialize
10+ init ( ) {
11+ self . contentView = T ( )
12+ super. init ( nibName: nil , bundle: nil )
13+ }
14+
15+ @available ( * , unavailable)
16+ required init ? ( coder: NSCoder ) {
17+ fatalError ( " init(coder:) has not been implemented " )
18+ }
19+
20+ // MARK: - Life Cycle
21+ override func loadView( ) {
22+ if contentView. backgroundColor == nil {
23+ contentView. backgroundColor = . white
24+ }
25+ view = contentView
26+ }
27+
28+ override func viewDidLoad( ) {
29+ super. viewDidLoad ( )
30+
31+ self . setupView ( )
32+ self . configure ( )
33+ self . setupLayout ( )
34+ self . bindAction ( )
35+ self . bindState ( )
36+ }
37+
38+ // MARK: - Common Methods
39+ func setupView( ) { }
40+ func configure( ) { }
41+ func setupLayout( ) { }
42+ func bindAction( ) { }
43+ func bindState( ) { }
44+ }
You can’t perform that action at this time.
0 commit comments