Skip to content

Instantly share code, notes, and snippets.

@pbrewczynski
Created March 16, 2014 20:03
Show Gist options
  • Save pbrewczynski/9589015 to your computer and use it in GitHub Desktop.
Save pbrewczynski/9589015 to your computer and use it in GitHub Desktop.
- (void) animateWordMeaningLabelToLefttAndUpdateRepetitionOnCompletion {
CGRect orginalPlaceOfWordMeaningLabel = self.wordMeaningLabel.frame;
[UIView animateWithDuration:0.5 animations:^{ // TODO magic number
CGRect frame = self.wordMeaningLabel.frame;
frame.origin.x = -self.wordMeaningLabel.frame.size.width;
self.wordMeaningLabel.frame = frame;
self.wordMeaningLabel.layer.backgroundColor = [self.crossContainer.backgroundColor colorWithAlphaComponent:1].CGColor;
self.crossContainer.layer.backgroundColor = [self.crossContainer.backgroundColor colorWithAlphaComponent:1].CGColor;
self.wordMeaningLableIsAnimating = YES;
} completion:^(BOOL finished){
self.wordMeaningLableIsAnimating = NO;
[self animateWordMeaningLabelFromMiddleTopToDesiredCenter:self.orginalCenterOfWordMeaningLabel];
[self updateRepetition];
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment