Number
public struct Number : Hashable
extension Number: CalculationOperandConvertible
extension Number: Shortcut
extension Number: ConditionNumberOperandConvertible
extension Number: ConditionOperandConvertible
extension Number: Encodable
extension Number: ExpressibleByFloatLiteral
extension Number: ExpressibleByIntegerLiteral
extension Number: CustomStringConvertible
extension Number: Comparable
extension Number: Equatable
A wrapper for numeric types supported by the Shortcuts app.
-
Returns a number initialized to contain a given value, treated as an Int8.
Declaration
Swift
public init(_ value: Int8)
Parameters
value
The value for the new number.
-
Returns a number initialized to contain a given value, treated as an Int16.
Declaration
Swift
public init(_ value: Int16)
Parameters
value
The value for the new number.
-
Returns a number initialized to contain a given value, treated as an Int32.
Declaration
Swift
public init(_ value: Int32)
Parameters
value
The value for the new number.
-
Returns a number initialized to contain a given value, treated as an Int64.
Declaration
Swift
public init(_ value: Int64)
Parameters
value
The value for the new number.
-
Returns a number initialized to contain a given value, treated as an integer of platform-dependent size.
Declaration
Swift
public init(_ value: Int)
Parameters
value
The value for the new number.
-
Returns a number initialized to contain a given value, treated as a UInt8.
Declaration
Swift
public init(_ value: UInt8)
Parameters
value
The value for the new number.
-
Returns a number initialized to contain a given value, treated as a UInt16.
Declaration
Swift
public init(_ value: UInt16)
Parameters
value
The value for the new number.
-
Returns a number initialized to contain a given value, treated as a UInt32.
Declaration
Swift
public init(_ value: UInt32)
Parameters
value
The value for the new number.
-
Returns a number initialized to contain a given value, treated as a UInt64.
Declaration
Swift
public init(_ value: UInt64)
Parameters
value
The value for the new number.
-
Returns a number initialized to contain a given value, treated as a unsigned integer of platform-dependent size.
Declaration
Swift
public init(_ value: UInt)
Parameters
value
The value for the new number.
-
Returns a number initialized to contain a given value, treated as a double-precision floating-point value.
Declaration
Swift
public init(_ value: Double)
Parameters
value
The value for the new number.
-
Returns a number initialized to contain a given value, treated as a single-precision floating-point value.
Declaration
Swift
public init(_ value: Float)
Parameters
value
The value for the new number.
-
Hashes the essential components of this value by feeding them into the given hasher.
Declaration
Swift
public func hash(into hasher: inout Hasher)
Parameters
hasher
The hasher to use when combining the components of this instance.
-
Declaration
Swift
public var calculationOperand: CalculationOperand { get }
-
The contents of the shortcut.
Declaration
Swift
public var body: some Shortcut { get }
-
A number operand that represents this value.
Declaration
Swift
public var conditionNumberOperand: ConditionNumberOperand { get }
-
An operand that represents this value.
Declaration
Swift
public var conditionOperand: ConditionOperand { get }
-
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.
-
Creates an instance initialized to the specified floating-point value.
Attention
Do not call this initializer directly. Instead, initialize a variable or constant using a floating-point literal.
Declaration
Swift
public init(floatLiteral value: Double)
Parameters
value
The value of the new instance.
-
Creates an instance initialized to the specified integer value.
Attention
Do not call this initializer directly. Instead, initialize a variable or constant using an integer literal.
Declaration
Swift
public init(integerLiteral value: Int64)
Parameters
value
The value of the new instance.
-
A textual representation of this instance.
Declaration
Swift
public var description: String { get }
-
Returns a Boolean value indicating whether the value of the first argument is less than that of the second argument.
Declaration
Swift
public static func < (lhs: Number, rhs: Number) -> Bool
Parameters
lhs
A value to compare.
rhs
Another value to compare.
Return Value
True the value of the first argument is less than that of the second argument, false otherwise.
-
Returns a Boolean value indicating whether two values are equal.
Declaration
Swift
public static func == (lhs: Number, rhs: Number) -> Bool
Parameters
lhs
A value to compare.
rhs
Another value to compare.
Return Value
True if the two values are equal, false otherwise.