0
let selector: Selector = #selector(getter: UIPrinter.displayName)
我想這條線轉換爲SWIFT 2.2轉換選擇器2.2
這裏的功能fullcode
func indexFiles() {
let selector: Selector = #selector(getter: UIPrinter.displayName)
sections = Array(repeating: [], count: collation.sectionTitles.count)
if let sortedObjects = collation.sortedArrayFromArray(files, collationStringSelector: selector) as? [FBFile]{
for object in sortedObjects {
let sectionNumber = collation.sectionForObject(object, collationStringSelector: selector)
sections[sectionNumber].append(object)
}
}
}
[引用吸氣劑是夫特3+特徵](https://github.com/apple/swift-evolution/blob/master/proposals/0064-property-selectors.md)。所以它可能需要一些包裝。 – user28434