Use a common init function in both of the provided initializers so that subclasses of `MGLAnnotationView` written in Swift don't need to override `init(annotation, reuseIdentifier)`
24 lines
538 B
Swift
24 lines
538 B
Swift
import XCTest
|
|
import Mapbox
|
|
|
|
class CustomAnnotationView: MGLAnnotationView {
|
|
|
|
override init(reuseIdentifier: String?) {
|
|
super.init(reuseIdentifier: reuseIdentifier)
|
|
}
|
|
|
|
required init?(coder aDecoder: NSCoder) {
|
|
super.init(coder: aDecoder)
|
|
}
|
|
|
|
}
|
|
|
|
class MGLAnnotationViewIntegrationTests: XCTestCase {
|
|
|
|
func testCreatingCustomAnnotationView() {
|
|
let customAnnotationView = CustomAnnotationView(reuseIdentifier: "resuse-id")
|
|
XCTAssertNotNil(customAnnotationView)
|
|
}
|
|
|
|
}
|