shortest answer ever.
All you need to do is call:
UIView.appearance().isExclusiveTouch = true
in the beginning of the app.
According to Doc:
Discussion
Setting this property to
true
causes the receiver to block the delivery of touch events to other views in the same window. The default value of this property isfalse
.
And when we use UIView.appearance()
, we get all the view being set to this property value.
For appearance, note that:
You can customize the appearance of instances of a class by sending appearance modification messages to the class’s appearance proxy.