SampleDatas.swift 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 UIKit
  14. struct Sample {
  15. let viewControllerClass: UIViewController.Type
  16. let title: String
  17. }
  18. struct Section {
  19. let name: String
  20. let samples: [Sample]
  21. }
  22. enum Samples {
  23. static func allSamples() -> [Section] {
  24. let autoCompleteSample: [Sample] = [
  25. Sample(
  26. viewControllerClass: AutocompletePushViewController.self,
  27. title: NSLocalizedString(
  28. "Demo.Title.Autocomplete.Push",
  29. comment: "Title of the pushed autocomplete demo for display in a list or nav header")),
  30. Sample(
  31. viewControllerClass: AutocompleteModalViewController.self,
  32. title: NSLocalizedString(
  33. "Demo.Title.Autocomplete.FullScreen",
  34. comment: "Title of the full-screen autocomplete demo for display in a list or nav header")
  35. ),
  36. Sample(
  37. viewControllerClass: AutocompleteWithCustomColors.self,
  38. title: NSLocalizedString(
  39. "Demo.Title.Autocomplete.Styling",
  40. comment: "Title of the Styling autocomplete demo for display in a list or nav header")),
  41. Sample(
  42. viewControllerClass: AutocompleteWithSearchViewController.self,
  43. title: NSLocalizedString(
  44. "Demo.Title.Autocomplete.UISearchController",
  45. comment:
  46. "Title of the UISearchController autocomplete demo for display in a list or nav header")
  47. ),
  48. Sample(
  49. viewControllerClass: AutocompleteWithTextFieldController.self,
  50. title: NSLocalizedString(
  51. "Demo.Title.Autocomplete.UITextField",
  52. comment: "Title of the UITextField autocomplete demo for display in a list or nav header")
  53. ),
  54. ]
  55. let likelihoodsSample: [Sample] = [
  56. Sample(
  57. viewControllerClass: FindPlaceLikelihoodListViewController.self,
  58. title: "Find Place Likelihoods")
  59. ]
  60. return [
  61. Section(name: "Autocomplete", samples: autoCompleteSample),
  62. Section(name: "Likelihoods", samples: likelihoodsSample),
  63. ]
  64. }
  65. }