BennyKJohnson / OpenCloudKit

Open Source CloudKit Framework
MIT License
96 stars 17 forks source link

Console app wait on operations to finish #5

Closed malhal closed 7 years ago

malhal commented 7 years ago

So I followed the example in the readme, but I had an issue that the program ended before the operation completion was called. I fixed it by placing a CFRunLoopRun() at the bottom of my code, I was wondering what your thoughts are on dealing with this?

BennyKJohnson commented 7 years ago

In order to receive callbacks on any asynchronous functions, some type of run loop must be in place. OpenCloudKit is mainly designed to be used with a Swift web framework such as Vapor or Perfect which implement their own run loops. However you can use it by itself using the CFRunLoopRun() as you mentioned.