ios - Firebase, Swift: Create a time checker in the background similar to the Snapchat streak system that performs an action when the time runs out -


i'm creating app (in xcode using swift) has streak system similar snapchat's. user completes daily task , can repeat daily task in 24 hours. there way create sort of countdown in firebase (the database i'm using) or in xcode can create 24h countdown in background , update ui when time next daily task. i'm new xcode , firebase , have searched on answer have never found one. ideas?

red button clicked , turns green -> creates 24h countdown user can see timer update on hourly basis -> countdown reaches 0 , green button turns red user click again

thanks again!

no need make use of timer or when user press button reactivated after 24 hours . save timestamp in reference node , overtime when user open app compare time stamp stored in reference , make green red if time exceeds more 24 hours . hope give brief idea how do. need save timestamp when user click , compare saved time +24 hours timestamp , result achieved. hope helps


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -