Fix action target self-reference timing issues

This commit is contained in:
relikd
2020-09-05 22:05:56 +02:00
parent d2fa67e0e3
commit 35a211f87f
2 changed files with 2 additions and 2 deletions

View File

@@ -9,7 +9,7 @@ class CustomAlert<CustomView: UIView>: UIViewController {
private var callback: ((CustomView) -> Void)?
/// Default: `[Cancel, Save]`
let buttonsBar: UIStackView = {
lazy var buttonsBar: UIStackView = {
let cancel = QuickUI.button("Cancel", target: self, action: #selector(didTapCancel))
let save = QuickUI.button("Save", target: self, action: #selector(didTapSave))
save.titleLabel?.font = save.titleLabel?.font.bold()

View File

@@ -59,7 +59,7 @@ class TutorialSheet: UIViewController, UIScrollViewDelegate {
return x
}()
private let button: UIButton = {
private lazy var button: UIButton = {
let x = QuickUI.button("", target: self, action: #selector(buttonTapped))
x.contentEdgeInsets = UIEdgeInsets(all: 8)
return x