Skip to content

Instantly share code, notes, and snippets.

@gavi
Created July 9, 2020 15:00
Show Gist options
  • Save gavi/37212123681a58fa60af4633be65ecd0 to your computer and use it in GitHub Desktop.
Save gavi/37212123681a58fa60af4633be65ecd0 to your computer and use it in GitHub Desktop.
import MapKit
import SwiftUI
import PlaygroundSupport
struct ContentView:View{
var body:some View{
VStack{
Text("Hello, World")
MapView()
}
}
}
struct MapView:UIViewRepresentable{
func makeUIView(context: Context) -> MKMapView{
let view = MKMapView(frame: CGRect.zero)
return view
}
func updateUIView(_ map: MKMapView, context: Context) {
map.mapType = .hybridFlyover
}
}
let contentView = ContentView()
PlaygroundPage.current.setLiveView(contentView)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment