File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -3,14 +3,15 @@ import UIKit
33
44extension Goal {
55 public var humanizedAutodata : String ? {
6- if self . autodata == " ifttt " { return " IFTTT " }
7- if self . autodata == " api " { return " API " }
8- if self . autodata == " apple " {
6+ guard let autodata, !autodata. isEmpty else { return nil }
7+ switch autodata {
8+ case " ifttt " : return " IFTTT "
9+ case " api " : return " API "
10+ case " apple " :
911 let metric = HealthKitConfig . metrics. first ( where: { $0. databaseString == self . healthKitMetric } )
1012 return self . healthKitMetric == nil ? " Apple " : metric? . humanText
13+ default : return autodata. capitalized
1114 }
12- if let autodata = self . autodata, autodata. count > 0 { return autodata. capitalized }
13- return nil
1415 }
1516
1617 public var isDataProvidedAutomatically : Bool { return !( self . autodata ?? " " ) . isEmpty }
You can’t perform that action at this time.
0 commit comments