手势、按钮等实现传入多个参数

2016-10-17  本文已影响0人  figure_ai
#import <UIKit/UIKit.h>
@interface LCHTapGestureRecognizer : UITapGestureRecognizer
/** url */
@property (strong , nonatomic) NSString* url;
@end
//添加点击手势
    NSString*url = @"http://www.jianshu.com";
    LCHTapGestureRecognizer *tap = [LCHTapGestureRecognizer new];
    tap.url = url;
    [tap addTarget:self action:@selector(clickShop:)];
    [view addGestureRecognizer:tap];
-(void)clickShop:(LCHTapGestureRecognizer *)tap
{
NSLog(@"%@",tap.url);
}
上一篇下一篇

猜你喜欢

热点阅读