« first day (1627 days earlier)      last day (1313 days later) » 

9:13 AM
@ShobhakarTiwari No :(
 
@bhakti123 where u stuck
 
I want to call a function at a specific time
it needs to run in background
i am making sure that at that time, the app is in background and not terminated
 
@bhakti123 okey great
 
but the problem is, it is not firing at that time
 
so you can do it using timer
 
9:17 AM
i am using timer only
but not working
and not at the time
the problem is, the function is being called when i am scheduling the timer
 
i am using this
let when = DispatchTime.now() + seconds // change 2 to desired number of seconds
print(when)
DispatchQueue.main.asyncAfter(deadline: when) {
 
okey wait
 
with swift3 should i use
 
9:23 AM
Timer(fire: <#T##Date#>, interval: <#T##TimeInterval#>, repeats: <#T##Bool#>, block: <#T##(Timer) -> Void#>)
Timer(fireAt: <#T##Date#>, interval: <#T##TimeInterval#>, target: <#T##Any#>, selector: <#T##Selector#>, userInfo: <#T##Any?#>, repeats: <#T##Bool#>)
i checked my quest on stackoverflow
people say to use the first one
but both of them are firing the function at the same time
and not when they are sceduled
 
0
A: Do something every x minutes in Swift

CanIn swift 3.0 the GCD got refactored: let timer : DispatchSourceTimer = DispatchSource.makeTimerSource(flags: [], queue: DispatchQueue.main) timer.scheduleRepeating(deadline: .now(), interval: .seconds(60)) timer.setEventHandler { NSLog("Hello World") } timer.resume() This is specially use...

 
use this with interval set to 0?
 
9:42 AM
@bhakti123 yes
 
so, in deadline: can i give a date?
 
in swift 3 .now wil give u date
 
no, it is asking for a dispatch time
.now means like right now
the current time
but i want to schedule it for later
ok, so i need to add the seconds from now to the time i want it to fire?
 
10:12 AM
@ShobhakarTiwari it is still not working
 
yea sure
jst try that way'
 
i did tyr
try*
but not working
 
can you send me ur project
is it demo prject !
 
no it is not a demo project
i am getting this error
 
10:23 AM
dnssd_clientstub write_all(27) DEFUNCT
2017-01-22 15:52:09.711711 Wake Up Buddy[2163:765838] dnssd_clientstub deliver_request ERROR: write_all(27, 68 bytes) failed
2017-01-22 15:52:09.711933 Wake Up Buddy[2163:765838] dnssd_clientstub write_all(27) DEFUNCT
 
10:45 AM
@bhakti123 weired error
:(
 
:(
actually i am reading data from pedometer here
i think i am doing something wrong it that
it is because in i am setting the timer on dispatch queue.main
and in the function that i am calling
i am using
DispatchQueue.main.sync(){
??
 
11:04 AM
@bhakti123 okey
 
 
4 hours later…
2:49 PM
Can any one know best api for video brodcasting in ios app + objective c
 

« first day (1627 days earlier)      last day (1313 days later) »