Post

Replies

Boosts

Views

Activity

I'm trying to understand Combine Future
I'm using playground to experiment with Combine. I found this example on a blog. I expect it to create the Future publisher, wait a couple seconds then send the promise and complete. import Foundation import Combine import SwiftUI let future = Future<Int, Never> { promise in     print("Creating")     DispatchQueue.global().asyncAfter(deadline: .now() + 2) {         print("sending promise")         promise(.success(1))     } } future     .sink(receiveCompletion: { print("receiveCompletion:\($0)") },             receiveValue: { print("receiveValue:\($0)") }) print("end") The output I expect: Creating end sending promise receiveValue: ... receiveCompletion: ... The output I get: Creating end sending promise I don't see an indication the promise was executed. What am I doing wrong?
2
0
1.1k
Jul ’21
Is there an easy workflow for Skeleton tracking?
Is there an easy(ier) way to work with skeleton tracking? I have an iPad on a stand and I am the model most of the time. I can't stand in front of the camera and see what's on the iPad. I don't think I can use the front camera for tracking. My wife is getting very tired of "Honey, can you come here a minute?" How is this supposed to work?
1
0
493
Apr ’22
CoreHID and customHID reports
I'm try to use CoreHID to communicate with a usb hid device that sends custom reports. I have been able to create a client, but when I try to access the elements I get this: IOServiceOpen failed: 0xe00002e2 also in: client.monitorNotifications(reportIDsToMonitor: [HIDReportID.allReports], elementsToMonitor: []) {... What do I put into "elementsToMonitor: []" array?
1
0
521
Jul ’24