chore: use instance method to observe highlighted property

This commit is contained in:
sunxiaojian 2021-03-03 11:30:25 +08:00
parent 384fe6018e
commit a0aa8b9194
1 changed files with 2 additions and 1 deletions

View File

@ -227,7 +227,8 @@ extension MastodonRegisterViewController {
setupOnboardingAppearance()
defer { setupNavigationBarBackgroundView() }
NSObject.KeyValueObservingPublisher<UIButton, Bool>(object: photoButton, keyPath: \.isHighlighted, options: NSKeyValueObservingOptions.new)
photoButton.publisher(for: \.isHighlighted, options: .new)
.receive(on: DispatchQueue.main)
.sink { [weak self] isHighlighted in
guard let self = self else { return }