subscript(_:as:default:)
Reads and writes the value at the given index as a Boolean value, falling back to the given default value.
Declaration
subscript(index: Int, as type: Bool.Type = Bool.self, default defaultValue: @autoclosure () -> Bool) -> Bool { get }Parameters
- index:
The position of the element to access.
- type:
The expected type for the returned value.
- defaultValue:
The value to use if no value for exists at
indexor if conversion totypefails.
Return Value
The value at the specified index in the array.