Share this page

by Mark Petherbridge     ios-blog.co.uk
Swift Version: 1.0

The NSTimer class can be used to create ‘timer’ objects in your iOS applications. Simply put – a timer. I’m sure you’ve all seen iOS applications that have a similar function to this. Ever wondered how they work? Wondering How NSTimer Works? Well, it works by waiting for a specific interval of time to elapse before it fires. Upon firing it will send a specified message to your swift app target object. For example you can tell your NSTimer object to send a message to a window with instructions to perform an update after a period of time has elapsed, or with this example update a label every second.




© 2015 SoSoSwift. Blog · About · Contact · Privacy policy · Terms of service · RSS