Removes all elements from the collection.
- iOS 7.0+
- macOS 10.9+
- UIKit for Mac 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
- Xcode 8.0+
trueto request that the collection avoid releasing its storage. Retaining the collection’s storage can be a useful optimization when you’re planning to grow the collection again. The default value is
Calling this method may invalidate any existing indices for use with this collection.
Complexity: O(n), where n is the length of the collection.