EmojiDataSource.swift 607 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // EmojiDataSource.swift
  3. // LoopKitUI
  4. //
  5. // Created by Michael Pangburn on 1/7/19.
  6. // Copyright © 2019 LoopKit Authors. All rights reserved.
  7. //
  8. struct EmojiSection {
  9. let title: String
  10. let items: [String]
  11. let indexSymbol: String
  12. }
  13. protocol EmojiDataSource {
  14. var sections: [EmojiSection] { get }
  15. }
  16. public enum EmojiDataSourceType {
  17. case food
  18. case override
  19. func dataSource() -> EmojiDataSource {
  20. switch self {
  21. case .food:
  22. return FoodEmojiDataSource()
  23. case .override:
  24. return OverrideEmojiDataSource()
  25. }
  26. }
  27. }