NSSortDescriptor即排序描述。
Symbols
1 Initializing a Sort Descriptor
// 初始化
public init(key: String?, ascending: Bool)
public init(key: String?, ascending: Bool, selector: Selector?)
2 Getting Information About a Sort Descriptor
// 关键字
open var key: String? { get }
// 是否升序
open var ascending: Bool { get }
// 方法监听
open var selector: Selector? { get }
3 Using Sort Descriptors
// 比较大小
open func compare(_ object1: Any, to object2: Any) -> ComparisonResult
// 排序顺序相反的描述
open var reversedSortDescriptor: Any { get }
@available(iOS 7.0, *)
open func allowEvaluation() // Force a sort descriptor which was securely decoded to allow evaluation
4 Create an NSComparator for the Sort Descriptor
// 获取比较器
@available(iOS 4.0, *)
open var comparator: Foundation.Comparator { get }
Appendix
Related Documentation
Key-Value Coding Programming Guide
Revision History
时间 | 描述 |
---|---|
2016-10-26 | 博文完成 |
Copyright
CSDN:http://blog.csdn.net/y550918116j
GitHub:https://github.com/937447974