2
2
mirror of https://github.com/mastodon/mastodon-ios synced 2025-04-11 22:58:02 +02:00

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

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 }