performSelector:withObject:afterDelay: not working from scrollViewDidZoom

后端 未结 2 1555
刺人心
刺人心 2020-12-31 16:28

I feel like I should know this but I\'ve been stumped for hours now and I\'ve run out of ideas.

The theory is simple, the user manipulates the zoom and positioning i

相关标签:
2条回答
  • 2020-12-31 16:44

    I think that timer events are ignored during tracking (when a finger is down in order to scroll or zoom). You might have to perform the selector in a different mode (see [NSObject performSelector:withObject:afterDelay:inModes:]). Specifically, try using @[NSRunLoopCommonModes] for the mode.

    0 讨论(0)
  • 2020-12-31 17:00

    Just to add onto what Brian said - here's my implementation of his answer:

    [self performSelector:@selector(callMethod) withObject:0 afterDelay:1.0 inModes:@[NSRunLoopCommonModes]];
    

    Note - inModes: takes an array of modes.

    0 讨论(0)
提交回复
热议问题