You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This causes default units appropriate for the platform to be used. Specifying any units explicitly causes just those units to be used in showing the number.
17
-
publicstaticletuseDefault=Units(rawValue:0)
18
16
// Specifying any of the following causes the specified units to be used in showing the number.
19
17
publicstaticletuseBytes=Units(rawValue:1 << 0)
20
18
publicstaticletuseKB=Units(rawValue:1 << 1)
@@ -50,9 +48,9 @@ open class ByteCountFormatter : Formatter {
50
48
NSUnimplemented()
51
49
}
52
50
53
-
/* Specify the units that can be used in the output. If ByteCountFormatter.Units.useDefault, uses platform-appropriate settings; otherwise will only use the specified units. This is the default value. Note that ZB and YB cannot be covered by the range of possible values, but you can still choose to use these units to get fractional display ("0.0035 ZB" for instance).
51
+
/* Specify the units that can be used in the output. If ByteCountFormatter.Units is empty, uses platform-appropriate settings; otherwise will only use the specified units. This is the default value. Note that ZB and YB cannot be covered by the range of possible values, but you can still choose to use these units to get fractional display ("0.0035 ZB" for instance).
54
52
*/
55
-
openvarallowedUnits:Units=.useDefault
53
+
openvarallowedUnits:Units=[]
56
54
57
55
/* Specify how the count is displayed by indicating the number of bytes to be used for kilobyte. The default setting is ByteCountFormatter.CountStyle.fileCount, which is the system specific value for file and storage sizes.
58
56
*/
@@ -127,52 +125,52 @@ open class ByteCountFormatter : Formatter {
127
125
*/
128
126
privatefunc convertValue(fromByteCount byteCount:Int64, for byteSize:[Unit:Double])->String{
129
127
letbyte=Double(byteCount)
130
-
if byte ==0, allowsNonnumericFormatting, allowedUnits ==.useDefault, includesUnit, includesCount {
128
+
if byte ==0, allowsNonnumericFormatting, allowedUnits ==[], includesUnit, includesCount {
0 commit comments