CSSearchableItemAttributeSet

  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: 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

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
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值