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:

  1. 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
  2. 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

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -