I'm attempting to consolidate what I currently have as an extension
into my struct MapView
.
extension MKCoordinateRegion {
var boundingBoxCoordinates: [CLLocationCoordinate2D] {
let halfLatDelta = self.span.latitudeDelta / 2
let halfLngDelta = self.span.longitudeDelta / 2
I'm not sure if I understand your question correctly but I think the problem is here: self.span
in MKCoordinateRegion
extension.
extension MKCoordinateRegion {
static let latitudeDelta: CLLocationDegrees = 1
static let longitudeDelta: CLLocationDegrees = 1
var boundingBoxCoordinates: [CLLocationCoordinate2D] {
let halfLatDelta = MKCoordinateRegion.latitudeDelta / 2
let halfLngDelta = MKCoordinateRegion.longitudeDelta / 2
.....
}
}
If you need to declare them as private static property, add private
keyword after static
.
Two Swift extension
rules to mention here: