Hi All,I have cracked it.Simply delay code execution using the Dispatch framework. GDC framework.> DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(2)) {> runagain() //this runs my code in the main thread.> //this code will be executed only after 2 seconds have been passed , I will eventually make this longer because I dont need to poll sensor as often. > }
Topic:
Programming Languages
SubTopic:
Swift
Tags: