I have a Map() coming from MapKit. The map should smoothly change its size between 300px and 600px when I press a button. I achieved the required functionality, but the map is very laggy while resizing (FPS drops down to 15-20). However, performance issue happens only on a real device (iphone 13), if I run the same code on a preview simulator in XCode everything works smoothly.
Map()
.frame(height: isMapExpanded ? 600 : 300)
Button("Expand map") {
withAnimation {
isMapExpanded.toggle()
}
}
I already have tried to use MapView instead of Map – same outcome.
Also, seems like internet has no mentions about such problem…
Maksim Petrov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.