PlacesClient
@objcMembers
public class PlacesClient : AbstractClient
Client for Algolia Places.
-
Algolia application ID.
Declaration
Swift
@objc public var appID: String? { get }
-
Algolia API key.
Declaration
Swift
@objc public var apiKey: String? { get set }
-
Create a new authenticated Algolia Places client.
Declaration
Swift
@objc public init(appID: String, apiKey: String)
Parameters
appID
The application ID (available in your Algolia Dashboard).
apiKey
A valid API key for the service.
-
Create a new unauthenticated Algolia Places client.
Note
The rate limit for the unauthenticated API is significantly lower than for the authenticated API.Declaration
Swift
@objc public init()
-
Search for places.
Declaration
Swift
@discardableResult @objc(search:completionHandler:) public func search(_ params: PlacesQuery, completionHandler: @escaping CompletionHandler) -> Operation
Parameters
params
Search parameters.
completionHandler
Completion handler to be notified of the request’s outcome.
Return Value
A cancellable operation.
-
Get a place by its objectID.
Declaration
Swift
@discardableResult @objc public func getObject(withID objectID: String, completionHandler: @escaping CompletionHandler) -> Operation
Parameters
objectID
Identifier of the object to retrieve.
completionHandler
Completion handler to be notified of the request’s outcome.
Return Value
A cancellable operation.