Fix Preferences Done button not working
This commit is contained in:
parent
5e2af7d678
commit
7506ff3225
|
@ -309,7 +309,7 @@ class BrowserNavigationController: UIViewController {
|
||||||
}
|
}
|
||||||
|
|
||||||
private func showPreferences() {
|
private func showPreferences() {
|
||||||
let host = UIHostingController(rootView: PreferencesView())
|
let host = UIHostingController(rootView: PreferencesView(dismiss: { self.dismiss(animated: true) }))
|
||||||
present(host, animated: true)
|
present(host, animated: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
struct PreferencesView: View {
|
struct PreferencesView: View {
|
||||||
@ObservedObject var preferences: Preferences = .shared
|
let dismiss: () -> Void
|
||||||
|
|
||||||
@Environment(\.presentationMode) @Binding var presentationMode: PresentationMode
|
@ObservedObject var preferences: Preferences = .shared
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationView {
|
NavigationView {
|
||||||
|
@ -31,7 +31,7 @@ struct PreferencesView: View {
|
||||||
|
|
||||||
private var doneButton: some View {
|
private var doneButton: some View {
|
||||||
Button(action: {
|
Button(action: {
|
||||||
presentationMode.dismiss()
|
dismiss()
|
||||||
}, label: {
|
}, label: {
|
||||||
Text("Done")
|
Text("Done")
|
||||||
})
|
})
|
||||||
|
@ -73,6 +73,6 @@ struct PreferencesView_Previews: PreviewProvider {
|
||||||
@State static var presented = true
|
@State static var presented = true
|
||||||
|
|
||||||
static var previews: some View {
|
static var previews: some View {
|
||||||
PreferencesView()
|
PreferencesView(dismiss: {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ struct TableOfContentsView: View {
|
||||||
}
|
}
|
||||||
.listStyle(PlainListStyle())
|
.listStyle(PlainListStyle())
|
||||||
.navigationBarTitle("Table of Contents", displayMode: .inline)
|
.navigationBarTitle("Table of Contents", displayMode: .inline)
|
||||||
.navigationBarItems(trailing: Button("Done", action: {
|
.navigationBarItems(leading: Button("Cancel", action: {
|
||||||
close(nil)
|
close(nil)
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<key>BrowserCore.xcscheme_^#shared#^_</key>
|
<key>BrowserCore.xcscheme_^#shared#^_</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>5</integer>
|
<integer>3</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>Gemini-iOS.xcscheme_^#shared#^_</key>
|
<key>Gemini-iOS.xcscheme_^#shared#^_</key>
|
||||||
<dict>
|
<dict>
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
<key>GeminiRenderer.xcscheme_^#shared#^_</key>
|
<key>GeminiRenderer.xcscheme_^#shared#^_</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>3</integer>
|
<integer>5</integer>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
<key>SuppressBuildableAutocreation</key>
|
<key>SuppressBuildableAutocreation</key>
|
||||||
|
|
Loading…
Reference in New Issue