FileSize
public struct FileSize : Encodable
A data size represented by a floating-point number and a unit of information or variable.
-
A floating-point number represented as optional text. When nil, represents “anything” in the Shortcuts app.
Declaration
Swift
public var number: Text?
-
A unit of information or a variable like
Variable.askEachTime
.Declaration
Swift
public var unit: VariableValue<ByteCountUnit>
-
Declaration
Swift
public init(number: Text?, unit: VariableValue<ByteCountUnit>)
Parameters
number
A floating-point number represented as optional text. When nil, represents “anything” in the Shortcuts app.
unit
A unit of information or a variable like
Variable.askEachTime
. -
Declaration
Swift
public init(number: Text?, unit: ByteCountUnit)
Parameters
number
A floating-point number represented as optional text. When nil, represents “anything” in the Shortcuts app.
unit
A unit of information.
-
Parameters
number
A floating-point number represented as optional text. When nil, represents “anything” in the Shortcuts app.
unit
A variable like
Variable.askEachTime
. -
Encodes this value into the given encoder.
Throws
This function throws an error if any values are invalid for the given encoder’s format.Declaration
Swift
public func encode(to encoder: Encoder) throws
Parameters
encoder
The encoder to write data to.