We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e5391b7 commit de348f1Copy full SHA for de348f1
ios/HackerNews/Web/WebView.swift
@@ -7,9 +7,12 @@
7
8
import Foundation
9
import SwiftUI
10
+import UIKit
11
import WebKit
12
13
struct WebViewContainer: View {
14
+ @Environment(\.openURL) var openURL
15
+
16
let url: URL
17
let title: String
18
@@ -19,6 +22,19 @@ struct WebViewContainer: View {
19
22
.navigationTitle(title)
20
23
.toolbarBackground(.visible, for: .navigationBar)
21
24
.toolbarBackground(Color(UIColor.systemBackground), for: .navigationBar)
25
+ .toolbar {
26
+ ToolbarItem(placement: .topBarTrailing) {
27
+ Menu {
28
+ Button {
29
+ openURL(url)
30
+ } label: {
31
+ Label("Open in browser", systemImage: "safari")
32
+ }
33
34
+ Image(systemName: "ellipsis")
35
36
37
38
}
39
40
0 commit comments