地址:https://github.com/lovisty/AgileTag
iOS8+
通過CocoaPods安裝
AgileTag 支持通過CocoaPods進(jìn)行安裝瘟滨。在Podfile文件中加上
pod"AgileTag"
直接加項(xiàng)目中使用
git clonehttps://github.com/lovisty/AgileTag
找到包含的文件Classes和Assets的AgileTag文件胜卤,直接把AgileTag拖到項(xiàng)目中。
導(dǎo)入頭文件:
#import "YFAgileTagView.h"
初始化以及賦值
YFAgileTagView*tagView=[[YFAgileTagViewalloc]initWithFrame:YOUR_FRAME];[tagViewsetIntervalVertical:10];//Tag之間的水平間距[tagViewsetIntervalHorizontal:15];//Tag之間的豎直間距[selfaddSubview:self.tagView];//賦值[self.tagViewsetSelectedDataArray:DATA_ARRAY];
提供的重要接口
//返回總高度self.tagView.finalHeightBlock=^(CGFloatheight){? };//添加tag[self.tagViewaddTagWithTitle:tagItem.currentTitleWithAnimation:YEScompleted:^{? ? ? ? ? }];//刪除tag[firstCell.tagViewremoveTagWithTitle:tagItem.currentTitleWithAnimation:YEScompleted:^{}];注:每次調(diào)用添加或者刪除tag后兜材,會(huì)自動(dòng)回調(diào)finalHeightBlock返回添加或者刪除后的高度,然后回調(diào)用completed。