Skip to content

Instantly share code, notes, and snippets.

@aceontech
Last active August 29, 2015 14:06
import UIKit
import MapKit
extension MKMapView {
/**
Closure passes itself in
*/
public typealias MKMapViewBuilderClosure = (MKMapView) -> Void
/**
Add convenience initializer with the builder as its
optional parameter
*/
public convenience init(builder:MKMapViewBuilderClosure?) {
self.init()
if let closure = builder {
closure(self)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment