FoodEmojiDataSource.swift 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //
  2. // FoodEmojiDataSource.swift
  3. // LoopKit
  4. //
  5. // Copyright © 2017 LoopKit Authors. All rights reserved.
  6. //
  7. public func CarbAbsorptionInputController() -> EmojiInputController {
  8. return EmojiInputController.instance(withEmojis: FoodEmojiDataSource())
  9. }
  10. private class FoodEmojiDataSource: EmojiDataSource {
  11. private static let fast: [String] = {
  12. var fast = [
  13. "🍭", "🍬", "🍯",
  14. "🍇", "🍈", "🍉", "🍊", "🍋", "🍌", "🍍",
  15. "🍎", "🍏", "🍐", "🍑", "🍒", "🍓", "🥝",
  16. "🌽", "🍿", "🍘", "🍡", "🍦", "🍧", "🎂", "🥠",
  17. "☕️",
  18. ]
  19. return fast
  20. }()
  21. private static let medium: [String] = {
  22. var medium = [
  23. "🌮", "🍟", "🍳", "🍲", "🍱", "🍛",
  24. "🍜", "🍠", "🍤", "🍥",
  25. "🥪", "🥫", "🥟", "🥡", "🍢", "🍣",
  26. "🍅", "🥔", "🥕", "🌶", "🥒", "🥗", "🍄", "🥦",
  27. "🍆", "🥥", "🍞", "🥐", "🥖", "🥨", "🥞", "🍙", "🍚",
  28. "🍼", "🥛", "🍮", "🥧",
  29. "🍨", "🍩", "🍪", "🍰", "🍫",
  30. ]
  31. return medium
  32. }()
  33. private static let slow: [String] = {
  34. var slow = [
  35. "🍕", "🥑", "🥜", "🌰", "🧀", "🍖", "🍗", "🥓",
  36. "🍔", "🌭", "🌯", "🍝", "🥩"
  37. ]
  38. return slow
  39. }()
  40. private static let other: [String] = {
  41. var other = [
  42. "🍶", "🍾", "🍷", "🍸", "🍺", "🍻", "🥂", "🥃",
  43. "🍹", "🥣", "🥤", "🥢", "🍵",
  44. "1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣",
  45. "6️⃣", "7️⃣", "8️⃣", "9️⃣", "🔟"
  46. ]
  47. return other
  48. }()
  49. let sections: [EmojiSection]
  50. init() {
  51. sections = [
  52. EmojiSection(
  53. title: LocalizedString("Fast", comment: "Section title for fast absorbing food"),
  54. items: type(of: self).fast,
  55. indexSymbol: " 🍭 "
  56. ),
  57. EmojiSection(
  58. title: LocalizedString("Medium", comment: "Section title for medium absorbing food"),
  59. items: type(of: self).medium,
  60. indexSymbol: "🌮"
  61. ),
  62. EmojiSection(
  63. title: LocalizedString("Slow", comment: "Section title for slow absorbing food"),
  64. items: type(of: self).slow,
  65. indexSymbol: "🍕"
  66. ),
  67. EmojiSection(
  68. title: LocalizedString("Other", comment: "Section title for no-carb food"),
  69. items: type(of: self).other,
  70. indexSymbol: "⋯ "
  71. )
  72. ]
  73. }
  74. }