IOS values ​​do not match

I applied a vertical slider in one of my applications, which is expanding UISlider. when the scrolling is completed / completed, I send commands to the server with the values ​​of the slider. Sometimes, when I scroll quickly up / down and release, the slider values ​​become inconsistent before sending the command and after sending the command.

-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
   NSLog(@"Value of Slider before sending command=%f",self.value);
   [self sendCommand]; // Here value is something else  
   [super touchesEnded:touches withEvent:event];
   NSLog(@"Slider value after sending command=%f",self.value); // Here value changed
}

But if I put a super challenge before sending a team, then everything will be fine. Please explain if anyone knows why this is happening.

[super touchesEnded:touches withEvent:event];

A more interesting fact: if I do not call super, then everything works well.

+6
source share
3 answers

, [super touchesEnded:touches withEvent:event]; - , . , .

.

0

, touchesEnded: , , , . , , , , - , , , , .

0

UIKit , Apple Pencil . UIKit , . . , call super, , . , [super touchesEnded:touches withEvent:event];

( ), , .

-1

Source: https://habr.com/ru/post/1016013/


All Articles