         case sensor
     }
 
-    public enum GlucoseTrend: Int {
+    public enum GlucoseTrend: Int, CaseIterable {
         case upUpUp         = 1
         case upUp           = 2
         case up             = 3

        case downDownDown   = 7
        case notComputable  = 8
        case rateOutOfRange = 9

        public var direction: String {
            switch self {

            self.trend = GlucoseTrend(rawValue: intTrend)
        } else if let stringTrend = rawValue["trend"] as? String, let intTrend = Int(stringTrend) {
            self.trend = GlucoseTrend(rawValue: intTrend)
        } else if let directionString = rawValue["direction"] as? String {
            self.trend = GlucoseTrend(direction: directionString)
        } else {
            self.trend = nil
        }
