KevinMartinez
06/07/2023, 8:20 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
}
}
I would really appreciate your help🙌Joel Denke
06/08/2023, 6:48 AMKevinMartinez
06/08/2023, 1:02 PMKevinMartinez
06/08/2023, 1:31 PMDima Avdeev
06/10/2023, 4:28 PMKevinMartinez
06/10/2023, 4:33 PM