auto layoutのconstraintをアニメーションで変更したい
最初はこんなふうに実装してたが、これだと意図したとおりにアニメーションが動いてくれない。
[UIView animateWithDuration:1.0f animations:^{
self.menuButtonHeight.constant = 120;
self.menuButtonWidth.constant = 120;
}];
これが正解。
self.menuButtonHeight.constant = 120;
self.menuButtonWidth.constant = 120;
[UIView animateWithDuration:1.0f animations:^{
[self.menuButton layoutIfNeeded];
}];