Latest 1.0.6
Homepage https://github.com/xiaoyang521style/ZYSearchingEngine
License MIT
Platforms ios 8.0, requires ARC
Authors

说明

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

使用方法

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]

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

Latest podspec

{
    "name": "ZYSearchingEngine",
    "version": "1.0.6",
    "summary": "SearchingEngine on iOS.",
    "homepage": "https://github.com/xiaoyang521style/ZYSearchingEngine",
    "license": {
        "type": "MIT",
        "file": "FILE_LICENSE"
    },
    "authors": {
        "u8d75u9633": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/xiaoyang521style/ZYSearchingEngine.git",
        "tag": "1.0.6"
    },
    "source_files": [
        "ZYSearchingEngine",
        "ZYSearchingEngine/*.{h,m}"
    ],
    "resources": "ZYSearchingEngine/*.{bundle}",
    "requires_arc": true
}

Pin It on Pinterest

Share This