最近接触的项目中很多地方需要用到按钮,按钮又是继承自UIControl,但是UIControl的有些事件名称太过相似,有时候搞的也挺纠结的(毕竟英语四级都没过啊...)
UIControlEventTouchDown = 1 << 0, // 手指落在按钮的一瞬间触发
UIControlEventTouchDownRepeat = 1 << 1, // 多点触碰的时候,当第二根以上的手指触摸触发
UIControlEventTouchDragInside = 1 << 2, // 手指在视图范围内拖动触发
UIControlEventTouchDragOutside = 1 << 3, // 手指在视图范围外拖动触发
UIControlEventTouchDragEnter = 1 << 4, // 手指从视图外拖动到视图内时触发
UIControlEventTouchDragExit = 1 << 5, // 手指从视图内部拖动到视图外时触发
UIControlEventTouchUpInside = 1 << 6, // 手指在视图内部抬起时触发
UIControlEventTouchUpOutside = 1 << 7, // 手指在视图外部抬起时触发
UIControlEventTouchCancel = 1 << 8, // 取消事件,放上了太多手指或者被上锁或者电话呼叫打断。
UIControlEventValueChanged = 1 << 12, // 当视图的值发生改变时,发送通知。
UIControlEventEditingDidBegin = 1 << 16, // UITextField
UIControlEventEditingChanged = 1 << 17, // 编辑状态改变
UIControlEventEditingDidEnd = 1 << 18, // 编辑结束
UIControlEventEditingDidEndOnExit = 1 << 19, // 'return key' ending editing
UIControlEventAllTouchEvents = 0x00000FFF, // for touch events
UIControlEventAllEditingEvents = 0x000F0000, // for UITextField
UIControlEventApplicationReserved = 0x0F000000, // range available for application use
UIControlEventSystemReserved = 0xF0000000, // range reserved for internal framework use
UIControlEventAllEvents = 0xFFFFFFFF
网友评论