iphone-Page-Navigation-on-uitableview -
i make 1 form display diamonds primary detail when select single row ,page navigate second page "detail page" show full detail of selected diamond.. (i use single uitableviewcell display full detail of diamond)
firstpage navigate second. code is
- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { self.diamonddetail = [[diamonddetail alloc] init]; dimentity *dim = [dimarray objectatindex:indexpath.row]; _diamonddetail.diamond = dim; self.title = @" detail "; [self.navigationcontroller pushviewcontroller: _diamonddetail animated:yes]; [self.tableview deselectrowatindexpath:indexpath animated:yes]; }
now ,, output of detail page on navigationbar left side there 1 button automatically generated " detail " when click button page again navigate first page..
but..
i want..
when user move his/her finger on ipad-iphone surface / uitableviewcell
from right left page should navigate..
how can
for have study uiswipegesturerecognizer
-(void)viewdidload { [super viewdidload]; // swipe left uiswipegesturerecognizer *swipeleft = [[uiswipegesturerecognizer alloc] initwithtarget:self action:@selector(handleswipeleft:)]; swipeleft.direction = uiswipegesturerecognizerdirectionleft; [self.view addgesturerecognizer:swipeleft]; [swipeleft release]; // swipe right uiswipegesturerecognizer *swiperight = [[uiswipegesturerecognizer alloc] initwithtarget:self action:@selector(handleswiperight:)]; swiperight.direction = uiswipegesturerecognizerdirectionright; [self.view addgesturerecognizer:swiperight]; [swiperight release]; } - (void)handleswipeleft:(uiswipegesturerecognizer *)recognizer { [self.navigationcontroller pushviewcontroller: _diamonddetail animated:yes] } - (void)handleswiperight:(uiswipegesturerecognizer *)recognizer { [self.navigationcontroller pushviewcontroller: _diamonddetail animated:yes] }
Comments
Post a Comment