UIButton *btn=[UIButton buttonWithType:UIButtonTypeCustom];
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(btnLong:)];
longPress.minimumPressDuration = 0.5; //定义按的时间
[btn addGestureRecognizer:longPress];