Name | Type | iOS | tvOS | watchOS | macOS |
---|---|---|---|---|---|
int |
Read-Only Property | 8+ | 9+ | 3+ | 10.10+ |
string |
Read-Only Property | 8+ | 9+ | 3+ | 10.10+ |
toggled |
Read-Only Property | 8+ | 9+ | 3+ | 10.10+ |
toggle() |
Mutating Method | 8+ | 9+ | 3+ | 10.10+ |
--
Return 1 if true, or 0 if false.
- type: Read-Only Property.
- return type: Int
- availability:
iOS 8+
tvOS 9+
watchOS 3+
macOS 10.10+
.
Example
true.int -> 1
--
Return "true" if true, or "false" if false.
- type: Read-Only Property.
- return type: String
- availability:
iOS 8+
tvOS 9+
watchOS 3+
macOS 10.10+
.
Example
false.string -> "false"
--
Return inversed value of bool.
- type: Read-Only Property.
- return type: Bool
- availability:
iOS 8+
tvOS 9+
watchOS 3+
macOS 10.10+
.
Example
false.toggled -> true
--
Toggle value for bool.
- type: Mutating Method.
- return type: Bool
- returns: inversed value of bool.
- availability:
iOS 8+
tvOS 9+
watchOS 3+
macOS 10.10+
.
Example
var x = true
x.toggle()
print(x) -> false