0001    //
0002    //  PeliasAutocompleteConfig.swift
0003    //  pelias-ios-sdk
0004    //
0005    //  Created by Matt Smollinger on 1/28/16.
0006    //  Copyright © 2016 Mapzen. All rights reserved.
0007    //
0008    
0009    import Foundation
0010    
0011    public struct PeliasAutocompleteConfig
PeliasSearchManager.swift:37
  public func autocompleteQuery(config: PeliasAutocompleteConfig) -> PeliasOperation {
PeliasSearchManager.swift:61
  private func executeAutocompleteOperation(config: PeliasAutocompleteConfig) -> PeliasOperation {
: AutocompleteAPIConfigData { 0012 0013 var focusPoint
PeliasAutocompleteConfig.swift:15
      appendQueryItem("focus.point.lat", value: String(focusPoint.latitude))
PeliasAutocompleteConfig.swift:16
      appendQueryItem("focus.point.lon", value: String(focusPoint.longitude))
PeliasAutocompleteConfig.swift:42
    self.focusPoint = focusPoint
: GeoPoint { 0014 didSet { 0015 appendQueryItem("focus.point.lat", value: String(focusPoint.latitude)) 0016 appendQueryItem("focus.point.lon", value: String(focusPoint.longitude)) 0017 } 0018 } 0019 var urlEndpoint = NSURL.init(string: "/v1/autocomplete", relativeToURL: PeliasSearchManager.sharedInstance.baseUrl)! 0020 0021 var searchText
PeliasAutocompleteConfig.swift:23
      appendQueryItem("text", value: searchText)
PeliasAutocompleteConfig.swift:40
    self.searchText = searchText
: String{ 0022 didSet { 0023 appendQueryItem("text", value: searchText) 0024 } 0025 } 0026 0027 var apiKey
PeliasAutocompleteConfig.swift:29
      if let key = apiKey where apiKey?.isEmpty == false {
PeliasAutocompleteConfig.swift:29
      if let key = apiKey where apiKey?.isEmpty == false {
PeliasAutocompleteConfig.swift:43
    apiKey = PeliasSearchManager.sharedInstance.apiKey
PeliasAutocompleteConfig.swift:47
      appendQueryItem("api_key", value: apiKey)
: String? { 0028 didSet { 0029 if let key = apiKey where apiKey?.isEmpty == false { 0030 appendQueryItem("api_key", value: key) 0031 } 0032 } 0033 } 0034 0035 var queryItems = [String:NSURLQueryItem]() 0036 0037 var completionHandler
PeliasAutocompleteConfig.swift:41
    self.completionHandler = completionHandler
: (PeliasResponse) -> Void 0038 0039 init(searchText: String, focusPoint: GeoPoint, completionHandler: (PeliasResponse) -> Void){ 0040 self.searchText = searchText 0041 self.completionHandler = completionHandler 0042 self.focusPoint = focusPoint 0043 apiKey = PeliasSearchManager.sharedInstance.apiKey 0044 defer { 0045 //didSet will not fire because self is not setup so we have to do this manually 0046 appendQueryItem("text", value: searchText) 0047 appendQueryItem("api_key", value: apiKey) 0048 appendQueryItem("focus.point.lat", value: String(focusPoint.latitude)) 0049 appendQueryItem("focus.point.lon", value: String(focusPoint.longitude)) 0050 } 0051 } 0052 }