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?
Post
Replies
Boosts
Views
Activity
I've been watching a 2019 Developer Video "Building Apps with RealityKit" and working along with it. It shows how to create a custom entity. It shows how to load entities from .usd files. How do you either load a custom entity, convert an Entity to a custom entity, or maybe move model hierarchy from an Entity to a custom entity? I assume there's a way to do this.
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?
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?
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
This looks like a low level error. I'm hoping someone in the community has seen it, maybe using IOKit and can point me to some information.