Marwan Ehab
08/10/2023, 9:44 AMDima Avdeev
08/10/2023, 11:28 AMMarwan Ehab
08/10/2023, 11:29 AMBrendan Weinstein
11/24/2023, 6:58 PMUIKitView
. The pattern I am currently using for doing this is to pass a () -> UIView
function from swift to kotlin at app startup, store the function in a singleton, and then use that function in various composables throughout the app when I want to generate a swift view to be used within a compose layout. I set and read from this function parameter only on the main thread.
In the parts of the app I do this, I see spontaneous EXC_BAD_ACCESS: Attempted to dereference garbage pointer
errors. Very hard to reproduce. I suspect these errors are from this pattern, but not 100% certain. My next step is to run an experiment on a very simple view where I'll expose 50% of users to code using this pattern, and 50% to not seeing this pattern.Brendan Weinstein
11/24/2023, 7:14 PM[weak self]
to callback. I was doing that in the function blocks I pass from swift to kotlin. I have a single UIViewController that launches compose, I need to pass self.view.bounds
or self.frame
for multiple views. I don't need the self
reference to be weak; since I have a single ViewController on ios side, I can just strong reference it since it will always be around anyway.Cheick Kante
12/28/2023, 9:12 PMMap(coordinateRegion: $region, annotationItems: locations){ location *in*
MapAnnotation(coordinate: location.coordinate) {
Circle()
.stroke(.red, lineWidth: 3)
.frame(width: 44, height: 44)
}
}
How would one go about doing this in Compose through MKMapView ?