I have been struggling with this problem for awhile now and understand why it's happening but don't know how to solve it! Appreciate any help in advance :) Now let me explain.
- I have an a. IB action hooked up for a UIButton click and a b. UILabel to display time
After button click start timer with the following code :
let aSelector : Selector = "updateSlideshowTimer" self.timer = NSTimer.scheduledTimerWithTimeInterval(1, target: self, selector: aSelector, userInfo: nil, repeats: true)
and continuously update label b. and updateSlideshowTimer is my function that changes the label.
The label updates no problem (when no user scrolling)... the only problem is that the label stops updating when a user scrolls and skips to correct time after scrolling stops.
I understand the main UI thread is blocking the updating label and probably need to use dispatch_async to perform the update. I tried dispatch_async function to call the two lines of code above but then the label stopped updating all-together. Any help on how this can be solved ?? Thank you very much :) Alex