首先,userInteractionEnabled是屬於IOS message消息機制中的一個環節,它代表着是否處理傳過來的objc_msgSend()消息事件.
當userInteractionEnabled背置為NO時,表示不響應objc_msgSend()消息事件,當userInteractionEnabled背置為YES時,則正常響應Touch、Move等事件。需要關注的是,在IOS中個UI控件默認值並不相同:
UIImageView 默認的userInteractionEnabled是NO;
UILabel默認 userInteractionEnabled是NO;
UIView的userInteractionEnabled默認是YES。
當一個視圖對象的userInteractionEnabled被置為NO,則這個視圖對象就被從響應者鏈里移除,它所負責響應的事件全部無效。所以他的subviews事件到此都會被丟棄。