Ich bekomme den Fehler: "Class 'ViewController' hat keine Initialisierer". Ich habe das Problem auf diese aufgerufene Funktion eingegrenzt. Sieht jemand das Problem?Erhalte Initialisierungsfehler auf ViewController
let locationManager1: CLLocationManager // your location manager
func addBoundry(loc: CLLocation)
{
if let loc: CLLocation! = locationManager1.location {
let center: CLLocationCoordinate2D = loc!.coordinate
let lat: CLLocationDegrees = center.latitude
let long: CLLocationDegrees = center.longitude
var points = [CLLocationCoordinate2DMake(lat,long),CLLocationCoordinate2DMake(lat,long),CLLocationCoordinate2DMake(lat,long),CLLocationCoordinate2DMake(lat,long)]
let polygon = MKPolygon(coordinates: &points, count: points.count)
mapView.addOverlay(polygon)
} else {
print("no location...")
}
}
Check [diese Suchergebnissen] (http://stackoverflow.com/search?q=%5Bswift%5D+class+has+no+initializer). – rmaddy