 
 // MARK: - GooglePlacesAutocomplete (UINavigationController)
 
-public class GooglePlacesAutocomplete: UINavigationController {
-  public var gpaViewController: GooglePlacesAutocompleteContainer!
-  public var closeButton: UIBarButtonItem!
-  
-  public var gpaService: GooglePlacesAutocompleteService!
+open class GooglePlacesAutocomplete: UINavigationController {
+  open var gpaViewController: GooglePlacesAutocompleteContainer!
+  open var closeButton: UIBarButtonItem!
+  
+  open var gpaService: GooglePlacesAutocompleteService!
 
   // Proxy access to container navigationItem
-  public override var navigationItem: UINavigationItem {
+  open override var navigationItem: UINavigationItem {
     get { return gpaViewController.navigationItem }
   }
 
-  public var placeDelegate: GooglePlacesAutocompleteDelegate? {
+  open var placeDelegate: GooglePlacesAutocompleteDelegate? {
     get { return gpaService.delegate }
     set { gpaService.delegate = newValue }
   }
   
-  public var locationBias: LocationBias? {
+  open var locationBias: LocationBias? {
     get { return gpaService.locationBias }
     set { gpaService.locationBias = newValue }
   }
 
-  public convenience init(apiKey: String, placeType: PlaceType = .All) {
+  public convenience init(apiKey: String, placeType: PlaceType = .all) {
     let service = GooglePlacesAutocompleteService(apiKey: apiKey, placeType: placeType)
     self.init(service:service)
   }

    
  }

  public var description: String {
    return "PlaceDetails: \(name) (\(latitude), \(longitude))"
  }
}

@objc public protocol GooglePlacesAutocompleteDelegate {
  optional func placesFound(places: [Place])
  optional func placeSelected(place: Place)
  optional func placeViewClosed()
}

// MARK: - GooglePlacesAutocompleteService

public class GooglePlacesAutocompleteService {
  var delegate: GooglePlacesAutocompleteDelegate?
  var apiKey: String?
  var places = [Place]()
  public var placeType: PlaceType = .All
  public var locationBias: LocationBias?
  public var country: String?
  
  public init(apiKey: String, placeType: PlaceType = .All) {
    self.apiKey = apiKey
    self.placeType = placeType
  }
  
  public func getPlaces(searchString: String, completion:(([Place]?, NSError?) -> Void)) {
    var params = [
      "input": searchString,
      "types": placeType.description,

}

public enum PlaceType: CustomStringConvertible {
  case all
  case geocode
  case address
  case establishment
  case regions
  case cities

  public var description : String {
    switch self {
      case .all: return ""
      case .geocode: return "geocode"
      case .address: return "address"
      case .establishment: return "establishment"
      case .regions: return "(regions)"
      case .cities: return "(cities)"
    }
  }
}

open class Place: NSObject {
  open let id: String
  open let desc: String
  open var apiKey: String?

  override open var description: String {
    get { return desc }
  }

