Hi there!! Community. I am new to learning KMM and...
# compose-android
k
Hi there!! Community. I am new to learning KMM and I would like to get your help that how to make a
ComposeUIViewController
get the fun that will have my MapView This is my fun in the Shared Module
Copy code
@Composable
fun SampleMap(view: @Composable () -> Unit) {
    Box(modifier = Modifier.fillMaxSize()){
        view.invoke()
    }
}
and this
Copy code
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
?
Copy code
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
    }
}
z
Couple things: 1. Please keep longer code segments to the thread, so they don’t take up a huge amount of space in the channel. 2. You can use code blocks (triple-back-quote) for multi-line code, renders a lot prettier. 3. This looks like a question for #compose-ios
k
Thank you for the recommendation