Post

Replies

Boosts

Views

Activity

Reply to Accessing Events from Video Device
The Apple driver has the UVC interface open all the time when the device is streaming, but not the device interface. You can send device commands or receive status over pipe 0. You would have to poll to get the button press. What platform is this on - macOS, or iPadOS? On macOS, if your button exposes a HID interface, you can use HID manager routines to get notifications of reports on the interrupt pipe. The system will attach its own driver to a keyboard or mouse, but it will leave a vendor-specific HID device alone, so your code can talk to it.
Topic: Media Technologies SubTopic: Video Tags:
Oct ’24
Reply to Can i use c++ in swift app project
Did you enable "C++ and Objective-C Interoperability" in the build settings (under Swift Compiler - Language)? What kind of interface does your library export? If it is C only, you won't need to do this. But if it exports any C++ symbols, or if its exposed headers include any C++ headers or data types, you're going to have to turn that interoperability on.
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’24
Reply to Help Needed: Linker Warnings and Duplicate Symbols Issue in Xcode 16.0
did you look at the detailed build log to see what the duplicate symbol is, and where it is defined? If you compare the detailed build log with the log from Xcode 15.3, this might guide you to a solution. To access the detailed build log, click on the little hamburger icon on the right of the screenshot you posted. If you think this is a regression in Xcode 16, submit a bug report using Feedback Assistant - bugs reported here aren't tracked, and there isn't enough information in your post for anyone to help you.
Sep ’24
Reply to DriverKit target built as dependency, header not found
I fixed this. The problem was a header file called Driver_public_shared.h, which was included in my Driver.cpp file. It lives on disk beside Driver.cpp. By default, header files have Project membership, so they are not copied into the resulting output bundle. If I give Driver_public_shared.h either Public or Private memberships of the dext target, it appears in the dext in the Headers or PrivateHeaders directory, and I can compile the delivery app, with the driver as a dependency. Interestingly, the header appears in the build folder in the dext in Products/Debug/Debug-driverkit. But the dext which is embedded in the delivery app has no Headers directory. That's fine by me, I didn't want to deliver any headers as part of the driver, but I don't understand why there had to be a Headers folder in some circumstances and not others, nor do I understand why it is removed when embedding the dext.
Sep ’24
Reply to Can't downgrade MacBook with external ssd
I'm not sure why it isn't working for you, but I'll tell you how I manage booting various OS versions from an external disk. Shut down the computer, boot into Recovery. by holding down the power button until Options appears. Enable booting from external volumes, in Startup Security. Reboot. Connect your external disk, in Disk Utility, select the entire disk (ESD310S...) and partition it. Select APFS as the partition type. After that is done, you'll have one volume called Untitled. Rename the Untitled volume to "OS Installers". Select the Container disk above the Untitled volume and choose to add a volume to it. Make the new volume APFS, call it "Sonoma". Then, softwareupdate --list-full-installers, to get the correct name for the installer. softwareupdate --fetch-full-installer --full-installer-version 14.6.1, for example. This will download an installer called "Install macOS Sonoma" to your /Applications folder. Drag the installer from /Applications to the "OS Installers" volume (I like to keep them around). Double-click Install macOS Sonoma, wait a while until it is verified. Once it is ready, you should be able to go through the steps to install Sonoma onto your external disk (volume), called Sonoma, and boot from it.
Topic: Community SubTopic: Apple Developers Tags:
Sep ’24
Reply to Child view does at first display when row selected in parent view
I tried your code and found the same thing. These posts talk about some similar issues. https://forums.developer.apple.com/forums/thread/661777 https://forums.developer.apple.com/forums/thread/659660 this one has a solution that worked https://forums.developer.apple.com/forums/thread/714912?answerId=728415022#728415022 here's your code, working (based on the solution in the last link above), but it doesn't look like your original implementation: @Environment(\.dismiss) var dismiss var mealName: String var body: some View { VStack { Text(mealName) Button("OK") { dismiss() } } .padding() } } struct ContentView: View { @State var meals: [Meal] = [ Meal(name: "filet steak"), Meal(name: "pepperoni pizza"), Meal(name: "pancakes"), Meal(name: "full breakfast") ] @State private var selectedMeal: Meal? var body: some View { NavigationStack { List { ForEach(meals) { meal in HStack { Button { selectedMeal = meal } label: { Text(meal.name) .font(.headline) } } } } .sheet(item: $selectedMeal) { item in SheetView(mealName: item.name) } } } } class Meal: Identifiable { var id: UUID = UUID() var name: String = "" init() {} init(id: UUID = UUID(), name: String) { self.id = id self.name = name } } that is, it has buttons not just simply lines of text. here's code that works around the issue another way, by passing a binding to the sheet and using a small delay before changing isShowingMealForm. @Environment(\.dismiss) var dismiss @Binding var mealName: String var body: some View { VStack { Text(mealName) Button("OK") { dismiss() } } .padding() } } struct ContentView: View { @State var meals: [Meal] = [ Meal(name: "filet steak"), Meal(name: "pepperoni pizza"), Meal(name: "pancakes"), Meal(name: "full breakfast") ] @State private var isShowingMealForm = false @State private var selectedMeal: Meal? @State private var mealName: String = "no meal selected" var body: some View { NavigationStack { List { ForEach(meals) { meal in HStack { Text(meal.name) .font(.headline) } .onTapGesture { if self.isShowingMealForm { self.isShowingMealForm = false DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) { self.selectedMeal = meal self.mealName = meal.name self.isShowingMealForm = true } } else { self.selectedMeal = meal self.mealName = meal.name self.isShowingMealForm = true } } } } } .sheet(isPresented: $isShowingMealForm) { SheetView(mealName: $mealName) } } } class Meal: Identifiable { var id: UUID = UUID() var name: String = "" init() {} init(id: UUID = UUID(), name: String) { self.id = id self.name = name } } This works too, but I am a loss to clearly explain why. I put a breakpoint in your original onTapGesture closure, and I can clearly see self.selectedMeal obstinately staying at nil even after the line self.selectedMeal = meal. It only works as expected after you click on another meal line. I'm not at all comfortable with arbitrary delays in code, and the version with .sheet(item) has fewer lines of code than the one with .sheet( isPresented: ), so I'd go with that. I'd love it if someone who understands this stuff could chime in and tell us why the observed behavior differs from the expected though.
Topic: UI Frameworks SubTopic: SwiftUI
Aug ’24
Reply to How to view USB descriptors?
that's interesting. I have version 666.4.0 of USB Prober, and it works for viewing USB descriptors on Apple Silicon (for me). It does a fine job of displaying parsed descriptors, better than the utilities I have found on Windows. I don't use it for anything else. I probably installed it long ago on an Intel machine, and the binary runs on my M1 Mac. The code is ancient - the logging function appears to rely on a kernel extension which simply isn't there any more. Related source code is at https://opensource.apple.com/source/IOUSBFamily/IOUSBFamily-540.4.1/USBProberV2/, in case anyone wants to stake a stab at modernizing it.
Aug ’24
Reply to Need free Apple developer account
Please see here https://developer.apple.com/support/compare-memberships For your own use on your own machine, you can "sign to run locally", and make up a bundle identifier for your app. If you need restricted entitlements, you need a paid account to request them. I don't know what you mean by "signingkey" and "signingkeyId". Are these Apple things or AWS things?
Jul ’24