Posts

Post not yet marked as solved
3 Replies
You can totally disregard my original reply. I believe, in looking into this more, that the issue actually lies in the assign(to:_, on:_), operation. This operation seems to be capturing a strong reference to self in the closure and creating issues when the class ImageLoader attempts to deinit. On the documentation side of things it looks like there is a new assign operation that was added to the OS updates from WWDC 2020 that is supposed to solve this issue, but it doesn't appear to return a cancellable (it actually returns Void) meaning that you cant capture the reference to the cancellable the way the code is written now. Assign 1: https://developer.apple.com/documentation/combine/anypublisher/assign(to:on:) vs Assign 2: https://developer.apple.com/documentation/combine/publisher/assign(to:) It's my working theory right now that the second assign is more inline with what you want without creating a strong reference to self and causing issues on deinit. Alternatively you can just use the .sink() operator to receive the value from the URLSession publisher. https://developer.apple.com/documentation/combine/publisher/sink(receivevalue:)
Post not yet marked as solved
3 Replies
It looks like the issue is in how/when you are subscribing to the queue. Try swapping line 32 and 33. This will ensure that you receive that publisher on the main queue before you subscribe to the queue.
Post not yet marked as solved
38 Replies
We've been seeing this issue with team members that upgraded to Xcode 12 beta 1 this past week. Feedback filed: FB7844232. Happy to provide additional information to anyone looking to debug further.