From a0aa8b9194e5aefc16115028a2fb7368e58ca69f Mon Sep 17 00:00:00 2001 From: sunxiaojian Date: Wed, 3 Mar 2021 11:30:25 +0800 Subject: [PATCH] chore: use instance method to observe highlighted property --- .../Onboarding/Register/MastodonRegisterViewController.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mastodon/Scene/Onboarding/Register/MastodonRegisterViewController.swift b/Mastodon/Scene/Onboarding/Register/MastodonRegisterViewController.swift index da6f570d..d95a0357 100644 --- a/Mastodon/Scene/Onboarding/Register/MastodonRegisterViewController.swift +++ b/Mastodon/Scene/Onboarding/Register/MastodonRegisterViewController.swift @@ -227,7 +227,8 @@ extension MastodonRegisterViewController { setupOnboardingAppearance() defer { setupNavigationBarBackgroundView() } - NSObject.KeyValueObservingPublisher(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 }