Taxi Noi Bai Ha Noi Taxi Noi Bai Ha Noi - 1 year ago 113
Swift Question

Completion handler is not called

Pardon me for beginner's question, I have this function with a completion handler, but it's not called when the function complete. Any tip? thanks

func updateDailyLength(completion: ()-> Void ) {
//do something here

And in the caller:

updateDailyLength(completion: { getMonthlyDistance() })

The function
is never called.

Answer Source

You need to call it from updateDailyLength

func updateDailyLength(completion: ()-> Void ) {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download