-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Site Settings in SwiftUI: General #20855
Conversation
@objc func languageSelector(_ selector: LanguageSelectorViewController, didSelect languageId: Int) { | ||
_ = navigationController?.popToViewController(self, animated: true) | ||
navigationController?.popViewController(animated: true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change doesn't affect any of the functionality because LanguageSelectorViewController
doesn't push any screens. The change was needed to make it work with SwiftUI.
@@ -0,0 +1,90 @@ | |||
import SwiftUI | |||
|
|||
struct SettingsPicker<T: Hashable>: View { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
|
0f40ef0
to
f25e2ab
Compare
@@ -3,25 +3,44 @@ import SwiftUI | |||
import Combine | |||
import SVProgressHUD | |||
|
|||
final class NewSiteSettingsViewController: UIHostingController<SiteSettingsView> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll rename it once the SiteSettingsViewController
is removed.
// MARK: - Helpers (Timezone) | ||
|
||
private func startTimezoneObserver() { | ||
self.timezoneObserver = TimeZoneObserver { [weak self] _, newState in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this code from the old SiteSettingsViewController
with almost no changes.
} | ||
} | ||
|
||
struct TimezoneSelectorView: UIViewControllerRepresentable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try to replace these screens as well if I have time, but it's at the bottom of the priority list because they are already written in Swift, and there aren't many reasons to replace them.
// The default `UISearchController` behavior, which is to hide the | ||
// navigation bar, was not working properly when presenting using | ||
// `UIViewControllerRepresentable`. | ||
viewController.hidesNavigationBarDuringPresentation = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty much the only limitation I encountered so far.
…gsView from UIKit
f25e2ab
to
8cfd8c8
Compare
HACK week: update Site Settings to use SwiftUI
Previous PR: #20838
This PR adds all of the fields from the "General" section to the new Site Settings screen.
SettingsPicker
to replaceSettingsSelectionViewController
To test:
Regression Notes
PR submission checklist:
RELEASE-NOTES.txt
if necessary.UI Changes testing checklist: