开发者

Slider set to continuous seems to block main thread

开发者 https://www.devze.com 2023-02-10 19:55 出处:网络
I\'m using a slider to resize some thumbnails in an app. I\'ve set the slider to continuous so it updates as you move the slider instead of when you finish moving it. Works great, except for one thing

I'm using a slider to resize some thumbnails in an app. I've set the slider to continuous so it updates as you move the slider instead of when you finish moving it. Works great, except for one thing:

The view that contains the thumbnails the slider resizes in in a split view. When the user starts sliding, i want to maximize said splitview for better usability. The only issue is, while the slider is being开发者_如何学Python moved, it appears to be blocking any resizing operations of the UI. Anyone know how I can un-block it?

Or perhaps know of a different approach?


I figured it out!

Dragging the slider changes the run loop mode. I was maximizing my split view using an animation which has an NSTimer as it's backbone. I was adding the timer to the default run loop mode, when i should have been doing this:

[[NSRunLoop mainRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号