- Getting an Attribute Set
- Working with Custom Attributes
- Describing Documents
- Describing Events
- Describing General Attributes
- Describing Places
- Describing Media
- Describing Music
- Describing Images
- Describing Messages
- Describing Containment
- Supporting Actions
CSSearchableItemAttributeSet声明CSSearchableItem包含的元数据。
1 Getting an Attribute Set
/// 初始化CSSearchableItemAttributeSet
///
/// - parameter itemContentType : 统一标签,如kUTTypePNG或kUTTypeMovie(import MobileCoreServices)
///
/// - returns: void
public init(itemContentType: String)
2 Working with Custom Attributes
/// 存储数据
///
/// - parameter value : 自定义属性,如NSString, NSNumber, NSNull, NSData, or NSDate, or an array
/// - parameter key : 属性keyCSCustomAttributeKey
///
/// - returns: void
public func setValue(value: NSSecureCoding?, forCustomKey key: CSCustomAttributeKey)
// 获取存储的数据
public func valueForCustomKey(key: CSCustomAttributeKey) -> NSSecureCoding?
3 Describing Documents
// 主题
public var subject: String?
// 主题
public var theme: String?
// 内容
public var contentDescription: String?
// 标示符
public var identifier: String?
// 所有者
public var audiences: [String]?
// 文件大小
public var fileSize: NSNumber?
// 页面总数
public var pageCount: NSNumber?
// 页面款第,每英寸72点
public var pageWidth: NSNumber?
// 页面高度,每英寸72点
public var pageHeight: NSNumber?
// 文件加密
public var securityMethod: String?
// 创建文件,如Word
public var creator: String?
// 内容转换为pdf流
public var encodingApplications: [String]?
// 种类
public var kind: String?
// 字体名
public var fontNames: [String]?
4 Describing Events
// 到期时间
public var dueDate: NSDate?
// 完成时间
public var completionDate: NSDate?
// 开始时间
public var startDate: NSDate?
// 结束时间
public var endDate: NSDate?
// 关联时间
public var importantDates: [NSDate]?
// 事件覆盖的天数
@NSCopying public var allDay: NSNumber?
5 Describing General Attributes
6 Describing Places
7 Describing Media
8 Describing Music
9 Describing Images
10 Describing Messages
11 Describing Containment
12 Supporting Actions
// 电话与item相连
@NSCopying public var supportsPhoneCall: NSNumber?
// 导航与itme相连
@NSCopying public var supportsNavigation: NSNumber?
Appendix
Sample Code
Related Documentation
Core Spotlight Framework Reference
CSSearchableItemAttributeSet Class Reference
Revision History
时间 | 描述 |
---|---|
2016-01-28 | 博文完成 |