I'm developing my first iPhone application. I have to update a label with the device speed every x seconds. I have created my own CLController
and I can get device speed but I don't know if I have got to use NSTimer
to update my label. How can I do it?
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Xcode: Is there a way to change line spacing (UI L
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
You can schedule the timer like this
Now below method will get called in every YOUR_INTERVAL (in seconds) periods
To stop the timer you could call invalidate on the timer object. So you might want to save the timer as a member variable, so that you can access it anywhere.
you are right you have to use NSTimer. You will be calling one method after x seconds and updating the label.