微信审核认证
1.首先进入这个平台
https://open.weixin.qq.com
2.创建应用 如果需要填Bundle id
Bundle id: com.optaim.tiantianyouyi
按提示步骤来即可
文章图片
Snip20160721_1.png
3.审核通过后
文章图片
Snip20160721_6.png import "IMJIETagView.h"
【微信审核认证】
@implementation IMJIETagView
-(id)initWithFrame
文章图片
CGRect)frame{
self = [super initWithFrame:frame];
if (self) {
selectedBtnList = [[NSMutableArray alloc] init];
self.clickBackgroundColor = [UIColor whiteColor];
self.clickTitleColor = TextColor;
self.clickArray = nil;
self.clickbool = YES;
self.borderSize = 0.5;
self.clickborderSize =0.5;
}
return self;
}
-(void)setTagsFrame
文章图片
IMJIETagFrame *)tagsFrame{
_tagsFrame = tagsFrame;
for (NSInteger i=0;
i
UIButton *tagsBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[tagsBtn setTitle:tagsFrame.tagsArray forState:UIControlStateNormal];
[tagsBtn setTitleColor:TextColor forState:UIControlStateNormal];
tagsBtn.titleLabel.font = TagTitleFont;
tagsBtn.tag = i;
tagsBtn.backgroundColor = [UIColor whiteColor];
[self makeCorner:self.borderSize view:tagsBtn color:UIColorRGBA(221, 221, 221, 1)];
tagsBtn.frame = CGRectFromString(tagsFrame.tagsFrames);
[tagsBtn addTarget:self action
文章图片
selector(TagsBtn
文章图片
forControlEvents:UIControlEventTouchDown];
tagsBtn.enabled = _clickbool;
[self addSubview:tagsBtn];
}
}
pragma mark 选中背景颜色
-(void)setClickBackgroundColor
文章图片
UIColor *)clickBackgroundColor{
if (_clickBackgroundColor != clickBackgroundColor) {
_clickBackgroundColor = clickBackgroundColor;
}
}
pragma makr 选中字体颜色
-(void)setClickTitleColor
文章图片
UIColor *)clickTitleColor{
if (_clickTitleColor != clickTitleColor) {
_clickTitleColor = clickTitleColor;
}
}
pragma makr 能否被选中
-(void)setClickbool
文章图片
BOOL)clickbool{
_clickbool = clickbool;
}
pragma makr 未选中边框大小
-(void)setBorderSize
文章图片
CGFloat)borderSize{
if (_borderSize!=borderSize) {
_borderSize = borderSize;
}
}
pragma makr 选中边框大小
-(void)setClickborderSize
文章图片
CGFloat)clickborderSize{
if (_clickborderSize!= clickborderSize) {
_clickborderSize = clickborderSize;
}
}
pragma makr 默认选择 单选
-(void)setClickString
文章图片
NSString *)clickString{
if (_clickString != clickString) {
_clickString = clickString;
}
if ([_tagsFrame.tagsArray containsObject:_clickString]) {
NSInteger index = [_tagsFrame.tagsArray indexOfObject:_clickString];
[self ClickString:index];
}
}
pragma mark 默认选择 多选
-(void)setClickArray
文章图片
NSArray *)clickArray{
if (_clickArray != clickArray) {
_clickArray = clickArray;
}
for (NSString *string in clickArray) {
if ([_tagsFrame.tagsArray containsObject:string]) {
NSInteger index = [_tagsFrame.tagsArray indexOfObject:string];
NSString *x = [[NSString alloc] initWithFormat
文章图片
"%ld",(long)index];
[self ClickArray:x];
}
}
}
pragma makr 单选
-(void)ClickString
文章图片
NSInteger )index{
UIButton *btn;
for (id obj in self.subviews) {
if ([obj isKindOfClass:[UIButton class]]) {
btn = (UIButton *)obj;
if (btn.tag == index){
btn.backgroundColor = [UIColor whiteColor];
[btn setTitleColor:_clickTitleColor forState:UIControlStateNormal];
[self makeCorner:_clickborderSize view:btn color:_clickTitleColor];
[_delegate IMJIETagView
文章图片
[[NSString stringWithFormat
文章图片
"%ld",(long)index]]];
}else{
btn.backgroundColor = [UIColor whiteColor];
[btn setTitleColor:TextColor forState:UIControlStateNormal];
[self makeCorner:_borderSize view:btn color:UIColorRGBA(221, 221, 221, 1)];
}
}
}
}
pragma mark 多选
-(void)ClickArray:(NSString *)index{
UIButton *btn;
for (id obj in self.subviews) {
if ([obj isKindOfClass:[UIButton class]]) {
btn = (UIButton *)obj;
if (btn.tag == [index integerValue]){
if ([selectedBtnList containsObject:index]) {
btn.backgroundColor = [UIColor whiteColor];
[btn setTitleColor:TextColor forState:UIControlStateNormal];
[self makeCorner:_borderSize view:btn color:UIColorRGBA(221, 221, 221, 1)];
[selectedBtnList removeObject:index];
}else{
btn.backgroundColor = [UIColor whiteColor];
[btn setTitleColor:_clickTitleColor forState:UIControlStateNormal];
[self makeCorner:_clickborderSize view:btn color:_clickTitleColor];
[selectedBtnList addObject:index];
}
[_delegate IMJIETagView:selectedBtnList];
}
}
}
}
-(void)makeCorner:(CGFloat)corner view:(UIView *)view color:(UIColor *)color{
CALayer * fileslayer = [view layer];
fileslayer.borderColor = [color CGColor];
fileslayer.borderWidth = corner;
}
-(void)TagsBtn:(UIButton *)sender{
if (self.clickStart == 0) {
//单选
[self ClickString:sender.tag];
}else{
//多选
NSString *x = [[NSString alloc] initWithFormat
文章图片
"%ld",(long)sender.tag];
[self ClickArray:x];
}
}
@end
推荐阅读
- 基于微信小程序带后端ssm接口小区物业管理平台设计
- 员工的微信朋友圈是公司的宣传阵地吗()
- FBI怎么和恐怖分子谈判
- 分享!如何分分钟实现微信扫二维码调用外部浏览器打开指定页面的功能
- 微信小程序基础知识
- 使用Promise对微信小程序wx.request请求方法进行封装
- 茶事|茶事 | 单丛里的一泡奇葩
- 微信小程序请求接口格式
- 才谷网(如何举办一场大型的微信投票活动())
- 我是如何给微信配图的()