Re: Multi-tasking
Swift doesn't implement garbage collection any more than C++ does, so that may be your issue.
For automatic handling of heap objects, it uses close logical equivalents of std::shared_ptr and std::weak_ptr, but elevated to being the default semantics and therefore obviating the syntactic burden. Classic Apple stuff: the way they want you to do it is easy, the other ways are absent.