Skip to content

Commit 849c8c1

Browse files
committed
Fixed Objective-C default host initialization
1 parent 429145b commit 849c8c1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

MapboxGeocoder/MBGeocoder.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,19 @@ public class MBGeocoder: NSObject {
2222
- param accessToken: A Mapbox access token.
2323
- param host: An optional hostname to the server API. The Mapbox Geocoding API endpoint is used by default.
2424
*/
25-
public init(accessToken: String, host: String? = nil) {
25+
public init(accessToken: String, host: String?) {
2626
configuration = MBGeocoderConfiguration(accessToken, host: host)
2727
}
2828

29+
/**
30+
Initializes a newly created geocoder with the given access token and the default host.
31+
32+
- param accessToken: A Mapbox access token.
33+
*/
34+
public convenience init(accessToken: String) {
35+
self.init(accessToken: accessToken, host: nil)
36+
}
37+
2938
private var task: NSURLSessionDataTask?
3039

3140
private var errorForSimultaneousRequests: NSError {

0 commit comments

Comments
 (0)