Tag: uigesturerecognizer uitapgesturerecognizer

触发UITapGestureRecognizer后,NSLayoutConsstraint常量不会影响视图

我有一个视图( self.view )是用另一个视图(而不是图层)使用UIView.mask属性UIView.mask 。 在UIPanGestureRecognizer我安装了一个UIPanGestureRecognizer所以当我在屏幕上平移面具变得越来越小相应。 另外我安装在UITapGestureRecognizer ,它增加了animationUIImageView s到屏幕上,他们在UIBezierPath进行animationUIBezierPath 。 我正在更新面具的大小与约束。 问题是,我点击屏幕添加animation的意见后,我对面具约束的变化停止影响。 我可以在日志中看到确实改变了约束的常量,并且UIPanGestureRecognizer仍然在工作。 所以我的意思是说遮罩视图约束停止影响其视图。 这是为什么? 谢谢 video插图: https : //youtu.be/UtNuc8nicgs 这里是代码: class UICircle: UIView { init() { super.init(frame: .zero) self.clipsToBounds = true self.backgroundColor = .yellow self.isUserInteractionEnabled = false } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } var diameterConstraint: NSLayoutConstraint? var animating = […]