CSSearchableItemAttributeSet

来源:互联网 发布:php地图定位源代码 编辑:程序博客网 时间:2024/06/18 17:50
  1. Getting an Attribute Set
  2. Working with Custom Attributes
  3. Describing Documents
  4. Describing Events
  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

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: voidpublic 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?// 创建文件,如Wordpublic 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

Swift

Core Spotlight Framework Reference

App Search Programming Guide

CSSearchableItemAttributeSet Class Reference

Revision History

时间 描述 2016-01-28 博文完成

CSDN:http://blog.csdn.net/y550918116j

GitHub:https://github.com/937447974/Blog

0 0