【发布时间】:2013-12-09 10:07:11
【问题描述】:
我正在创建一个自定义 NSLayoutConstraint 子类,我需要知道布局约束的 constant 属性当前是否正在为内部状态处理设置动画。也就是说,我需要区分:
{ //no animation
myLayoutConstraint.constant = 100;
}
和
{ //animated
myLayoutConstraint.constant = 100;
[UIView animateWithDuration:0.2 animations:^{
[self.myViewThatHasTheConstraintAttached layoutIfNeeded];
} completion:^(BOOL finished) {
[...]
}];
}
这样我就可以处理在动画中间接收消息的极端情况。这可能吗?
【问题讨论】:
标签: ios objective-c cocoa-touch core-animation nslayoutconstraint