Animate relayout in Kittens example

This commit is contained in:
Huy Nguyen
2015-11-03 19:51:31 +02:00
parent 5701cbba40
commit 9e4c274a5b

View File

@@ -191,7 +191,17 @@ static const CGFloat kInnerPadding = 10.0f;
- (void)toggleNodesSwap
{
_swappedTextAndImage = !_swappedTextAndImage;
[self setNeedsLayout];
[UIView animateWithDuration:0.15 animations:^{
self.alpha = 0;
} completion:^(BOOL finished) {
[self setNeedsLayout];
[self.view layoutIfNeeded];
[UIView animateWithDuration:0.15 animations:^{
self.alpha = 1;
}];
}];
}
@end