there is no error in code and don't need any modification.you just access them with wrong way. here the code for it.
-(void)handlePan:(UIGestureRecognizer *) sender
{
if ((UIButton *)[sender.view viewWithTag:0]) //where no. '0' tag of button.;
{
// code it
}
if ((UIButton *)[sender.view viewWithTag:1])
{
// code it
}
}