Posts

Post not yet marked as solved
2 Replies
1.4k Views
Hi,On one of my apps, I have been adding some MKPointAnnotations to a map and showing a pin and showing some text as a title above the pin,Fairly basic code as per below.(Not full code of course, just to give an idea.)func addMarkerToMap() { let annotation = MKPointAnnotation() annotation.title = "My Title" annotation.coordinate = CLLocationCoordinate2D(latitude: sLatitude!, longitude: sLongitude!) myMap.addAnnotation(annotation)}func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? { if annotation is MKPointAnnotation { let pinAnnotationView = MKPinAnnotationView(annotation: annotation, reuseIdentifier: "myPin") pinAnnotationView.pinTintColor = .blue pinAnnotationView.isDraggable = false pinAnnotationView.canShowCallout = true pinAnnotationView.animatesDrop = true pinAnnotationView.isSelected = true return pinAnnotationView } return nil }}This has been working fine until IOS was updated to IOS 13.4.Now it will only ever show a title if it only contains 1 character.Any more than 1 character and all the pin title shows is 3 dots.Does anyone know if this is a IOS bug, or is there a way I can set the frame size of the MKPointannotation so that I can once again fit the full title in?Thanks for any advice.
Posted
by WBT.
Last updated
.
Post marked as solved
3 Replies
486 Views
Can someone tell me please is it possible to create a query for cloudkit which will perform an operation on the records within cloudkit and just return a result based on those records.For example,If there were 100 records in cloudkit, and one of the fields was age, can a query be constructed to look at all records and just return the average age, rather than having to download every record and then perform the calculation.Thanks.
Posted
by WBT.
Last updated
.
Post marked as solved
3 Replies
532 Views
Hi,Swift just threw me a warning which is going against what I thought I new.If someone can offer some clarification that would be appreciated.I have an object called deliveryCustomer which contains such fields as.id .firstname.companyNameetc etc...I am running a for loop and grabbing an array of customers as follows..//**LOOP THROUGH THE JSON ARRAY** for anItem in jsonResult as! [Dictionary<String, AnyObject>] { var deliveryCustomer:deliveryCustomers = deliveryCustomers() if let idString = (anItem["id"]) as? NSString { deliveryCustomer.id = idString } if let firstNameString = (anItem["firstName"]) as? NSString { deliveryCustomer.firstName = firstNameString }}you get the idea...In my line where I declare var deliveryCustomer, swift is suggesting that I replace this with a let.My understanding was that once I declare it as a let, I can no longer modify the variable, but in my code, I am modifying it in quite a few locations in the for loop.Can someone please advise if the warning is correct, and I am able to replace this var as a let??Thanks,Wade.
Posted
by WBT.
Last updated
.