objective c - Strikethrough Text with Animation iOS -
what best way display strikethrough animation? when user swipes finger across uitableviewcell, animate thin line across cell.textlabel.text
the 2 ways i've thought of far using animation or somehow displaying custom image , revealing left right? have advice on this?
i have swipe gestures working, need know how make animation happen:
add gesture recognizer:
//add left swipe gesture recognizer uiswipegesturerecognizer *recognizer = [[uiswipegesturerecognizer alloc] initwithtarget:self action:@selector(handleswipeleft:)]; [recognizer setdirection:(uiswipegesturerecognizerdirectionleft)]; [self.tableview addgesturerecognizer:recognizer]; //add right swipe gesture recognizer recognizer = [[uiswipegesturerecognizer alloc] initwithtarget:self action:@selector(handleswiperight:)]; recognizer.delegate = self; [recognizer setdirection:(uiswipegesturerecognizerdirectionright)]; [self.tableview addgesturerecognizer:recognizer];
delegate methods gestures:
- (void)handleswipeleft:(uiswipegesturerecognizer *)gesturerecognizer { nslog(@"uncompleted"); } // cross item off of list - (void)handleswiperight:(uiswipegesturerecognizer *)gesturerecognizer { nslog(@"completed"); }
based on have far following should work:
- when handleswipeleft (or right) fires, place new uiview black background color on textfield @ textfield's x point , around halfway y point width of 0 , height of 1
- then, call [uiview animationwithduration....] changing uiview's width property width of textfield.
this should close want tweaking. don't think possible animate strikethrough using properties of font alone technique should simulate fine.
good job on getting half way there.
Comments
Post a Comment