When the user touches the screen, this is called a "user interaction". For a UIView, this property is defaulted to true. In code this property is userInteractionEnabled.
(Xcode 8, Swift 3.0)
Observations
- Unchecking this property for a button prevents that button from being touched.
- If a UIView has User Interaction Enabled set to false, touches will still pass through to the views below it.
Example:
A - A UIView with User Interaction Enabled set to false.
B - A UIButton.
The button can still be clicked. - Animations set User Interaction Enabled to false during the animation.
- Setting User Interaction Enabled to false on a parent UIView will disable user interaction on all UIViews within the parent (all subviews).
Example:
The button will not work.
(Xcode 8, Swift 3.0)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.