iphone - touchesEnded not getting called when combined with UIButton? -


i've implemented when uibutton highlighted , uiswipegesturerecognizer recognizes gesture begin animation. problem want end animation when touchesended gets called after selecting uibutton , making gesture. touchesended never gets called if tap uibutton in process.

the rest of time works, useless me if can't use during animation. here did:

-(ibaction) swipedown:(uiswipegesturerecognizer *)recognizer {      if(onebutton.highlighted)      {           //animate      } }  - (void)touchesended:(nsset *)touches withevent:(uievent *)event  {      for(uitouch *touch in touches)     {          if(touch.phase == uitouchphaseended)         {              nslog(@"touched");         }      }  } 

any ideas?

instead of touchesended, add action button triggered when released.

[button addtarget:self action:@selector(buttontapended) forcontrolevents:(uicontroleventtouchupinside|uicontroleventtouchupoutside)]; 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -