This file contains 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 QuoteView: UIView { | |
private let portraitImageView: UIImageView = { | |
let imageView = UIImageView() | |
imageView.layer.cornerRadius = 64 | |
imageView.clipsToBounds = true | |
return imageView | |
}() |
This file contains 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 | |
protocol ReusableViewControllerDelegate { | |
func loadView() | |
func viewDidLoad() | |
func viewWillAppear(_ animated: Bool) | |
func viewWillLayoutSubviews() | |
func viewDidLayoutSubviews() | |
func viewDidAppear(_ animated: Bool) | |
func viewWillDisappear(_ animated: Bool) |
This file contains 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 ReusableViewController: UIViewController { | |
private let contentView: UIView | |
init(with view: UIView) { | |
self.contentView = view | |
super.init(nibName: nil, bundle: nil) | |
} | |
required init?(coder: NSCoder) { | |
fatalError("init(coder:) has not been implemented") |
This file contains 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 ReusableViewController: UIViewController { | |
var didLoadView: (() -> Void?)? | |
var willAppearView: ((_ animated: Bool) -> Void)? | |
private let contentView: UIView | |
init(with view: UIView) { | |
self.contentView = view |
This file contains 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 | |
protocol ReusableViewControllerDelegate { | |
func viewDidLoad() | |
func viewWillAppear(_ animated: Bool) | |
} | |
final class ReusableViewController: UIViewController { | |
var delegate: ReusableViewControllerDelegate? | |
private let contentView: UIView |
This file contains 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 | |
protocol ReusableViewControllerDelegate { | |
func handle(_ event: ReusableViewController.Event) | |
} | |
final class ReusableViewController: UIViewController { | |
enum Event { | |
case viewDidLoad | |
case viewWillAppear(_ animated: Bool) |
This file contains 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 | |
protocol ReusableViewControllerViewDidLoadDelegate { | |
func viewDidLoad() | |
} | |
protocol ReusableViewControllerViewWillAppearDelegate { | |
func viewWillAppear(_ animated: Bool) | |
} |
This file contains 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 | |
@objc protocol ReusableViewControllerDelegate { | |
@objc optional func viewDidLoad() | |
@objc optional func viewWillAppear(_ animated: Bool) | |
} | |
final class ReusableViewController: UIViewController { | |
var delegate: ReusableViewControllerDelegate? | |
private let contentView: UIView |
This file contains 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 | |
protocol ReusableViewControllerDelegate { | |
func viewDidLoad() | |
func viewWillAppear(_ animated: Bool) | |
} | |
extension ReusableViewControllerDelegate { | |
func viewDidLoad() {} | |
func viewWillAppear(_ animated: Bool) {} |
This file contains 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 | |
protocol ReusableViewControllerDelegate { | |
func loadView() | |
func viewDidLoad() | |
func viewWillAppear(_ animated: Bool) | |
func viewWillLayoutSubviews() | |
func viewDidLayoutSubviews() | |
func viewDidAppear(_ animated: Bool) | |
func viewWillDisappear(_ animated: Bool) |
OlderNewer