有没有办法来调用多个UIControlEvents选择?
这并不工作,但itl'll作罢什么,我试图做一个想法。
[self.slider addTarget:self action:@selector(sliderDidStopDragging:) forControlEvents:UIControlEventTouchUpInside, UIControlEventTouchUpOutside];
谢谢!!
有没有办法来调用多个UIControlEvents选择?
这并不工作,但itl'll作罢什么,我试图做一个想法。
[self.slider addTarget:self action:@selector(sliderDidStopDragging:) forControlEvents:UIControlEventTouchUpInside, UIControlEventTouchUpOutside];
谢谢!!
尝试这种方式来代替:
// same selector for different events
[self.button addTarget:self action:@selector(selector0:) forControlEvents:UIControlEventTouchUpInside];
[self.button addTarget:self action:@selector(selector0:) forControlEvents:UIControlEventTouchUpOutside];
// etc...
或者你可以使用这个:
// different selectors for same event
[self.button addTarget:self action:@selector(selector1:) forControlEvents:UIControlEventTouchUpInside];
[self.button addTarget:self action:@selector(selector2:) forControlEvents:UIControlEventTouchUpInside];
// etc...
只要OR
它们:
[self.button addTarget:self action:@selector(selector0:) forControlEvents:(UIControlEventTouchUpInside|UIControlEventTouchUpOutside)];