objective c - iOS Simulator Not Recognizing Gestures -
i adding uiswipegesturerecognizer , uitapgesturerecognizer view in view controller's viewdidload method.
- (void)viewdidload { [super viewdidload]; [self.view addgesturerecognizer:[[uiswipegesturerecognizer alloc] initwithtarget:self action:@selector(cardswipe:)]]; [self.view addgesturerecognizer:[[uitapgesturerecognizer alloc] initwithtarget:self action:@selector(cardtap:)]]; } - (void)cardswipe:(uiswipegesturerecognizer *)sender { //get card. set faceup false. cgpoint location = [sender locationinview:sender.view]; nsindexpath *cellindex = [self.cardcollectionview indexpathforitematpoint:location]; if(cellindex){ uicollectionviewcell *cell = [self collectionview:self.cardcollectionview cellforitematindexpath:cellindex]; if(cell && [cell iskindofclass:[cardcollectionviewcell class]]){ [[((cardcollectionviewcell *)cell) cardview] handlecardswipe]; } } } - (void)cardtap:(uitapgesturerecognizer *)sender { //get card. set faceup false. cgpoint location = [sender locationinview:sender.view]; nsindexpath *cellindex = [self.cardcollectionview indexpathforitematpoint:location]; if(cellindex){ uicollectionviewcell *cell = [self collectionview:self.cardcollectionview cellforitematindexpath:cellindex]; if(cell && [cell iskindofclass:[cardcollectionviewcell class]]){ [[((cardcollectionviewcell *)cell) cardview] handlecardswipe]; } } } in case relevant: view contains uicollectionview.
the taps , swipes not getting recognized. there obvious missing? thanks.
turns out view not responding gestures - scrolling, taps on buttons or swipe actions. deleted generated folders ~/library/application support/iphone simulator / 6.1/applications , ~/library/developer/xcode/deriveddata, reset simulator settings (from ios simulator > reset contents , settings), did clean in xcode (product > clean) , ran app again. gestures recognized. not sure of above fixed problem...it possible resetting simulator's contents , settings have been enough.
Comments
Post a Comment