q
Hello everyone,
I am using Xcode and trying to display Satelite data on my app,
this is the link to the data i want to add: NASA Worldview
However, I don’t know how to add it yet, I usually never get a view.
Here is what I coded in DataVisualization.swift:
import SwiftUI
import WebKit
struct DataVisualizationView: View {
var body: some View {
WebView(url: URL(string: "https://doi.org/10.5067/MODIS/MOD21.NRT.061")!)
.edgesIgnoringSafeArea(.all)
}
}
struct WebView: UIViewRepresentable {
let url: URL
func makeUIView(context: Context) -> WKWebView {
let webView = WKWebView()
return webView
}
func updateUIView(_ webView: WKWebView, context: Context) {
let request = URLRequest(url: url)
webView.load(request)
}
}
I am not sure what lines to add to the rest of my files like contentView etc. as I already have a weather app that uses API on there so I don’t exactly know how to add.