Open4
NSTimeZone NameStyle
iOSのTimeZoneのNameStyleに関する記事がないのでメモ
TimeZoneをいい感じに表示する時に使う
public enum NameStyle : Int {
case standard = 0
case shortStandard = 1
case daylightSaving = 2
case shortDaylightSaving = 3
case generic = 4
case shortGeneric = 5
}
NameStyle
は全部で6つ
Text(timeZone.localizedName(for: NSTimeZone.NameStyle.standard, locale: .current)!)
これでどうなるか検証する
NameStyle | Result |
---|---|
standard |
|
shortStandard |
|
daylightSaving |
|
shortDaylightSaving |
|
generic |
|
shortGeneric |