Skip to content

Instantly share code, notes, and snippets.

@aceontech
Last active August 29, 2015 14:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aceontech/8c0c682daa433862a2ed to your computer and use it in GitHub Desktop.
Save aceontech/8c0c682daa433862a2ed to your computer and use it in GitHub Desktop.
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