mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Revised settings views
Notes: - A lot of representable shims over UIKit view controllers. These misbehave a little. They should be re-written in SwiftUI. - Settings no longer uses VibrantTableViewCell - Changes to AppDefaults trigger objectWillSend
This commit is contained in:
@@ -8,8 +8,37 @@
|
||||
|
||||
import Account
|
||||
import UIKit
|
||||
import SwiftUI
|
||||
import RSCore
|
||||
|
||||
struct AddAccountViewControllerRepresentable: UIViewControllerRepresentable {
|
||||
func makeUIViewController(context: Context) -> AddAccountViewController {
|
||||
let storyboard = UIStoryboard(name: "Settings", bundle: .main)
|
||||
let controller = storyboard.instantiateViewController(withIdentifier: "AddAccountViewController") as! AddAccountViewController
|
||||
|
||||
context.coordinator.parentObserver = controller.observe(\.parent, changeHandler: { vc, _ in
|
||||
vc.parent?.title = vc.title
|
||||
vc.parent?.navigationItem.rightBarButtonItems = vc.navigationItem.rightBarButtonItems
|
||||
})
|
||||
|
||||
return controller
|
||||
}
|
||||
|
||||
func updateUIViewController(_ uiViewController: AddAccountViewController, context: Context) {
|
||||
//
|
||||
}
|
||||
|
||||
typealias UIViewControllerType = AddAccountViewController
|
||||
|
||||
class Coordinator {
|
||||
var parentObserver: NSKeyValueObservation?
|
||||
}
|
||||
|
||||
func makeCoordinator() -> Self.Coordinator { Coordinator() }
|
||||
|
||||
}
|
||||
|
||||
|
||||
protocol AddAccountDismissDelegate: UIViewController {
|
||||
func dismiss()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user