AppDelegate.swift 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2020 Google LLC. All rights reserved.
  2. //
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
  5. // file except in compliance with the License. You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software distributed under
  10. // the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
  11. // ANY KIND, either express or implied. See the License for the specific language governing
  12. // permissions and limitations under the License.
  13. import GooglePlaces
  14. import UIKit
  15. @UIApplicationMain
  16. class AppDelegate: UIResponder, UIApplicationDelegate {
  17. var window: UIWindow?
  18. func application(
  19. _ application: UIApplication,
  20. didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  21. ) -> Bool {
  22. GMSPlacesClient.provideAPIKey(apiKey)
  23. let viewController = SampleListViewController()
  24. let frame = UIScreen.main.bounds
  25. let window = UIWindow(frame: frame)
  26. window.rootViewController = UINavigationController(rootViewController: viewController)
  27. window.makeKeyAndVisible()
  28. self.window = window
  29. return true
  30. }
  31. }