码迷,mamicode.com
首页 > 移动开发 > 详细

searchAPI(iOS 9新api)

时间:2015-07-16 22:22:28      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:

searchAPI(iOS 9新api)

by 伍雪颖


var searchableItems = [CSSearchableItem]()
let attributeSet = CSSearchableItemAttributeSet(itemContentType: "image" as String)
attributeSet.
title = "wuxueying"
attributeSet.
contentDescription = "rain"
attributeSet.
thumbnailData = UIImagePNGRepresentation(UIImage(named: "avatar")!)

let item = CSSearchableItem(uniqueIdentifier: "1",
    domainIdentifier:
"com.xueying.SearchAPIs.people",
    attributeSet: attributeSet)
searchableItems.
append(item)

CSSearchableIndex.defaultSearchableIndex().indexSearchableItems(searchableItems,
    completionHandler: nil)

版权声明:本文为博主原创文章,未经博主允许不得转载。

searchAPI(iOS 9新api)

标签:

原文地址:http://blog.csdn.net/rainlesvio/article/details/46916299

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!