Ключ, как я обнаружил, заключается в создании подкласса UISegmentedControl. В обычных условиях UISegmentedControl просто не отвечает на UIControlEventTouchUpInside. Подклассифицируя UISegmentedControl, вы можете переопределить функцию touchesEnded (которая, по сути, является тем, что запускается при касании объекта):
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
[super touchesEnded:touches withEvent:event];
[self.superview touchesEnded:touches withEvent:event];
MyViewController *vc; // the view controller which contains the UISegmentedControl
for (UIView* next = [self superview]; next; next = next.superview) {
UIResponder* nextResponder = [next nextResponder];
if ([nextResponder isKindOfClass:[MyViewController class]]) {
vc = (MyViewController*)nextResponder;
break;
}
}
if (vc) {
[vc myFunction];
}
}