Post not yet marked as solved
I'm trying to get a new value on annotationView.center. And it sometimes returns the last location that I have already got. It was working fine before iOS 15.3. But after iOS 15.3 update, it started to be intermittent.
Code:
[NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
if let annotationView = object as? MKAnnotationView {
let position = annotationView.center
}
}
Post not yet marked as solved
When closing the lines of a polygon that is being drawn on the map using MapKit, we observe that the polygon is no longer closing. We didn't have any changes in the application and it stopped working after the iOS version 15.3 update. Until the previous versions it worked normally.
if (mainGleba.tamanhoArea != nil && mainGleba.tamanhoArea! > 0) {
if let areaText = formatter.string(from: mainGleba.tamanhoArea!) {
print("Área text: \(areaText)")
areaSize = sizeArea as! Double
textFieldArea.text
= "\(areaText.replacingOccurrences(of: ",", with:
".").formatToLocalCurrency(with: 2)) \.
(mainGleba.unidadeMedidaArea!)"
}
}else{
if let areaText = formatter.string(from: sizeArea) {
print("Área text: \(areaText)")
areaSize = sizeArea as! Double
textFieldArea.text
= "\(areaText.replacingOccurrences(of: ",", with:
".").formatToLocalCurrency(with: 2)) \
(mainGleba.unidadeMedidaArea!)"
}
}
func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer {
let polygonView = MKPolygonRenderer(overlay: overlay)
polygonView.strokeColor = Color.white()
if let _ = overlay as? MKPolygon{
polygonView.fillColor = Color.set(Color.white(), alpha: 0.2)
}
if(isAreaEnquadrada){
polygonView.strokeColor = Color.blue().withAlphaComponent(0.5)
polygonView.fillColor = Color.blue().withAlphaComponent(0.3)
}
polygonView.lineWidth = 2.0
polygonView.lineCap = CGLineCap.****
isAreaEnquadrada = false
return polygonView
}