Removes all elements from the array.
SDK
- Xcode 9.0+
Framework
- Swift Standard Library
Declaration
mutating func removeAll(keepingCapacity keepCapacity: Bool = false)
Parameters
keepCapacityPass
trueto keep the existing capacity of the array after removing its elements. The default value isfalse.
Discussion
Complexity: O(n), where n is the length of the array.