KevinMartinez
06/07/2023, 9:01 PMComposeUIViewController
get the fun that will have my MapView
This is my fun in the Shared Module
@Composable
fun SampleMap(view: @Composable () -> Unit) {
Box(modifier = Modifier.fillMaxSize()){
view.invoke()
}
}
and this
actual fun getPlatformName(): String = "iOS"
fun MainViewController() = ComposeUIViewController { App() }
and I want to get this in the IOS code. So how could I do the _*ComposeUIViewControlle*_r
?
struct MapView: UIViewRepresentable {
let coordinate: CLLocationCoordinate2D
func makeUIView(context: Context) -> MKMapView {
let map = MKMapView()
let region = MKCoordinateRegion(
center: coordinate,
latitudinalMeters: 1000,
longitudinalMeters: 1000)
map.setRegion(region, animated: true)
return map
}
func updateUIView(_ view: MKMapView, context: Context) {
// Update the view as necessary
}
}
Zach Klippenstein (he/him) [MOD]
06/07/2023, 10:09 PMKevinMartinez
06/08/2023, 1:00 PM