SkillAgentSearch skills...

ZYSearchingEngine

No description available

Install / Use

/learn @xiaoyang521style/ZYSearchingEngine
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

ZYSearchingEngine

说明

汉字拼音搜索,多音节,位置计算

使用方法

pod 'ZYSearchingEngine'

1.首先建立继承ZYSEModel类

#import "ZYSEModel.h"

@interface ZYPersonModel : ZYSEModel @property(nonatomic, copy)NSString *name; @property(nonatomic, copy)NSString *other; @end

2.建立继承ZYSEModel的对象并添加搜索关键字

ZYPersonModel *model = [[ZYPersonModel alloc]init]; model.other = dic[@"my"]; model.name = dic[@"name"];        [ZYSEManager addInitializeSearchValue:dic[@"name"] identifer:[NSString stringWithFormat:@"%d",i] model:model]; [self.modelArr addObject:model];

3.查询搜索对象

for (ZYPersonModel *model in self.modelArr) { SearchResultModel *resultModel = [ZYPinYinTools searchEffectiveResultWithSearchString:keyWord model:model]; if (resultModel.highlightedRange.length) { model.highlightLoaction = resultModel.highlightedRange.location; model.textRange = resultModel.highlightedRange; model.matchType = resultModel.matchType; [resultDataSource addObject:model]; }

效果图

baidu-images

View on GitHub
GitHub Stars7
CategoryDevelopment
Updated8y ago
Forks0

Languages

Objective-C

Security Score

65/100

Audited on Jan 15, 2018

No findings