ฉันมี 2 ปุ่มที่มี "UILongPressGestureRecognizer" ต้องทำ:
ปุ่มโฟกัส 1:
-(IBAction)seleccionar46:(id)sender{
UILongPressGestureRecognizer *longpressGesture =[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPressHandler:)];
longpressGesture.minimumPressDuration = 3;
[longpressGesture setDelegate:self];
[self.button1 addGestureRecognizer:longpressGesture];}
สำหรับปุ่ม 2:
-(IBAction)seleccionar46:(id)sender{
UILongPressGestureRecognizer *longpressGesture =[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPressHandler:)];
longpressGesture.minimumPressDuration = 3;
[longpressGesture setDelegate:self];
[self.button2 addGestureRecognizer:longpressGesture];}
และใน "longpressGesture" ฉันต้องการแยกความแตกต่างระหว่างปุ่ม 1 และปุ่ม 2 แต่ทำไม่ได้...
- (void)longPressHandler:(UILongPressGestureRecognizer *)gestureRecognizer{//Here i need do the differentation}
ขอบคุณสำหรับทุกอย่าง!
ขอแสดงความนับถืออย่างสูง.