Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kylehickinson authored Jan 2, 2020
1 parent 250098c commit ec43520
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,28 @@ import SwiftUI
import WebView

struct ContentView: View {
@EnvironmentObject var webViewStore: WebViewStore
@ObservedObject var webViewStore = WebViewStore()

var body: some View {
NavigationView {
WebView(webView: webViewStore.webView)
.navigationBarTitle(Text(verbatim: webViewStore.webView.title ?? ""))
.navigationBarTitle(Text(verbatim: webViewStore.webView.title ?? ""), displayMode: .inline)
.navigationBarItems(trailing: HStack {
Button(action: goBack) {
Image(systemName: "chevron.left")
.resizable()
.imageScale(.medium)
.imageScale(.large)
.aspectRatio(contentMode: .fit)
.frame(width: 32, height: 32)
}.disabled(!webViewStore.webView.canGoBack)
Button(action: goForward) {
Image(systemName: "chevron.right")
.resizable()
.imageScale(.medium)
.imageScale(.large)
.aspectRatio(contentMode: .fit)
.frame(width: 32, height: 32)
}.disabled(!webViewStore.webView.canGoForward)
})
}.onAppear {
self.webViewStore.webView.load(URLRequest(url: URL(string: "https://apple.com")!))
self.webViewStore.webView.load(URLRequest(url: URL(string: "https://apple.com")!))
}
}

Expand All @@ -48,5 +46,4 @@ struct ContentView: View {
webViewStore.webView.goForward()
}
}

```

0 comments on commit ec43520

Please sign in to comment.