【Swift】IndexSet

目的是为了看到Swift项目中的以下代码:

private extension IndexPath {
    
    static let configSection = 0
    static let provisionersSection = 1
    static let networkKeysSection = 2
    static let optionsSection = 3
    static let numberOfSections = optionsSection + 1
    
    static let configurationTitles = [
        "Export Everything"
    ]
    
    static let detailsTitles = [
        "Export Device Keys"
    ]
    
}

private extension IndexSet {
    
    static let all = IndexSet(integersIn: 1..<IndexPath.numberOfSections)
    static let config = IndexSet([IndexPath.configSection])
    static let provisioners = IndexSet([IndexPath.provisionersSection])
    static let networkKeys = IndexSet([IndexPath.networkKeysSection])
    static let options = IndexSet([IndexPath.optionsSection])
    
}

 

参考文章:

http://t.zoukankan.com/yuqingzhude-p-4844897.html

posted @ 2022-12-30 21:02  码出境界  阅读(418)  评论(0编辑  收藏  举报