Skip to content

Commit c805a25

Browse files
author
iBinh
committed
add custom token in AutocompleteVC
1 parent eaca5f5 commit c805a25

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

GoongGeocoder/GoongAutocompleteViewController.swift

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,20 @@ import UIKit
1010
var searchBar:UISearchBar?
1111
var searchedPlaces = [Prediction]()
1212
let decoder = JSONDecoder()
13-
let geocoder = Geocoder.shared
13+
var geocoder: Geocoder!
1414
@objc public weak var delegate: GoongAutocompleteDelegate?
15+
16+
init() {
17+
super.init(nibName: nil, bundle: nil)
18+
}
19+
@objc public convenience init(accessToken: String) {
20+
self.init()
21+
self.geocoder = Geocoder(accessToken: accessToken)
22+
}
23+
24+
required public init?(coder: NSCoder) {
25+
fatalError("init(coder:) has not been implemented")
26+
}
1527
override open func viewDidLoad() {
1628
super.viewDidLoad()
1729

0 commit comments

Comments
 (0)