moved isUserInteractive to isEnabled setter

This commit is contained in:
Matt Bruce 2022-08-31 09:05:38 -05:00
parent a0bc95d849
commit 126b094178
4 changed files with 12 additions and 0 deletions

View File

@ -43,6 +43,7 @@ open class CollectionViewCell<ModelHandlerType: ModelHandlerable & UIView>: UICo
if model.disabled != disabled {
model.disabled = disabled
}
isUserInteractionEnabled = isEnabled
}
}

View File

@ -42,6 +42,7 @@ open class Control<ModelType: Modelable>: UIControl, ModelHandlerable, ViewProto
if model.disabled != disabled {
model.disabled = disabled
}
isUserInteractionEnabled = isEnabled
}
}
@ -81,6 +82,14 @@ open class Control<ModelType: Modelable>: UIControl, ModelHandlerable, ViewProto
}
}
override open func accessibilityActivate() -> Bool {
// Hold state in case User wanted isAnimated to remain off.
guard isUserInteractionEnabled else { return false }
sendActions(for: .touchUpInside)
return true
}
//--------------------------------------------------
// MARK: - Overrides
//--------------------------------------------------

View File

@ -42,6 +42,7 @@ open class View<ModelType: Modelable>: UIView, ModelHandlerable, ViewProtocol, R
if model.disabled != disabled {
model.disabled = disabled
}
isUserInteractionEnabled = isEnabled
}
}

View File

@ -42,6 +42,7 @@ open class LabelBase<ModelType: LabelModel>: UILabel, ModelHandlerable, ViewProt
if model.disabled != disabled {
model.disabled = disabled
}
isUserInteractionEnabled = isEnabled
}
}