IOS动画 — Masony&Animation

简单记录下一个结合Masony做Animation的实现方式

直接附上代码示例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[self.loginView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.view.mas_bottom);
make.leading.mas_equalTo(self.view.mas_leading);
make.trailing.mas_equalTo(self.view.mas_trailing);
make.height.mas_equalTo(maxHeight);
}];
[self.avatarImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(120);
make.centerX.mas_equalTo(self.loginView.mas_centerX);
make.centerY.mas_equalTo(self.loginView.mas_top);
}];
[UIView animateWithDuration:duration animations:^{
[self.view layoutIfNeeded];
}];