TableViewOption.swift 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //
  2. // TableViewOption.swift
  3. // SheeeeeeeeetExample
  4. //
  5. // Created by Daniel Saidi on 2017-11-27.
  6. // Copyright © 2017 Daniel Saidi. All rights reserved.
  7. //
  8. /*
  9. This enum is used by the example app, to populate the table
  10. view in the main example view controller.
  11. */
  12. import UIKit
  13. enum TableViewOption {
  14. case
  15. danger,
  16. collections,
  17. customView,
  18. headerView,
  19. links,
  20. multiSelect,
  21. nonDismissable,
  22. sections,
  23. singleSelect,
  24. standard
  25. var title: String {
  26. switch self {
  27. case .collections: return "Collection items"
  28. case .customView: return "Custom view"
  29. case .danger: return "Destructive Action"
  30. case .headerView: return "Header View"
  31. case .links: return "Link items"
  32. case .multiSelect: return "Multi-select items"
  33. case .nonDismissable: return "Non-dismissable sheets"
  34. case .sections: return "Section items"
  35. case .singleSelect: return "Single-select items"
  36. case .standard: return "Standard items"
  37. }
  38. }
  39. var description: String {
  40. switch self {
  41. case .collections: return "Show a sheet with horizontal collections items."
  42. case .customView: return "Custom view items can embed any view."
  43. case .danger: return "Show a sheet with a destructive action."
  44. case .headerView: return "Show a sheet with a custom header view."
  45. case .links: return "Show a sheet with tappable links."
  46. case .multiSelect: return "Show a sheet where you can select multiple values."
  47. case .nonDismissable: return "Show a sheet that cannot be dismissed by tapping outside the sheet."
  48. case .sections: return "Show a sheet where items are divided in sections."
  49. case .singleSelect: return "Show a sheet where you can select a single value."
  50. case .standard: return "Show a sheet where you can pick a single option."
  51. }
  52. }
  53. var image: UIImage? {
  54. return UIImage(named: imageName)
  55. }
  56. var imageName: String {
  57. switch self {
  58. case .collections: return "ic_view_module"
  59. case .customView: return "ic_custom"
  60. case .danger: return "ic_warning"
  61. case .headerView: return "ic_header_view"
  62. case .links: return "ic_arrow_right"
  63. case .multiSelect: return "ic_checkmarks"
  64. case .sections: return "ic_sections"
  65. case .singleSelect: return "ic_checkmark"
  66. case .standard: return "ic_list"
  67. case .nonDismissable: return "ic_list"
  68. }
  69. }
  70. }