Set
1. 集合类型的hash值
public protocol Hashable : Equatable {
var hashValue: Int { get }
func hash(into hasher: inout Hasher)
}
2. 初始化,构造一个集合
// Set 没有简化的初始化版本
var set1 = Set<Character>()
// 使用数组字面值创建集合
var set2 : Set<Int> = [1,2,3]
3. 插入元素
4. 删除元素
5.遍历集合
6. 集合操作

最后更新于