FoodEmojiDataSource.swift 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. "🍯", "🍼", "🥛", "☕️", "🍵",
  20. "🥥", "🥦", "🥨", "🥠", "🥧",
  21. ]
  22. return fast
  23. }()
  24. private static let medium: [String] = {
  25. var medium = [
  26. "🌮", "🍆", "🍟", "🍳", "🍲", "🍱", "🍛",
  27. "🍜", "🍠", "🍤", "🍥", "🍹",
  28. "🥪", "🥫", "🥟", "🥡",
  29. ]
  30. return medium
  31. }()
  32. private static let slow: [String] = {
  33. var slow = [
  34. "🍕", "🥑", "🥜", "🌰", "🧀", "🍖", "🍗", "🥓",
  35. "🍔", "🌭", "🌯", "🍝", "🥩"
  36. ]
  37. return slow
  38. }()
  39. private static let other: [String] = {
  40. var other = [
  41. "🍶", "🍾", "🍷", "🍸", "🍺", "🍻", "🥂", "🥃",
  42. "🥣", "🥤", "🥢",
  43. "1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣",
  44. "6️⃣", "7️⃣", "8️⃣", "9️⃣", "🔟"
  45. ]
  46. return other
  47. }()
  48. let sections: [EmojiSection]
  49. init() {
  50. sections = [
  51. EmojiSection(
  52. title: LocalizedString("Fast", comment: "Section title for fast absorbing food"),
  53. items: type(of: self).fast,
  54. indexSymbol: " 🍭 "
  55. ),
  56. EmojiSection(
  57. title: LocalizedString("Medium", comment: "Section title for medium absorbing food"),
  58. items: type(of: self).medium,
  59. indexSymbol: "🌮"
  60. ),
  61. EmojiSection(
  62. title: LocalizedString("Slow", comment: "Section title for slow absorbing food"),
  63. items: type(of: self).slow,
  64. indexSymbol: "🍕"
  65. ),
  66. EmojiSection(
  67. title: LocalizedString("Other", comment: "Section title for no-carb food"),
  68. items: type(of: self).other,
  69. indexSymbol: "⋯ "
  70. )
  71. ]
  72. }
  73. }