Post

Replies

Boosts

Views

Activity

Reply to Can't receive notification from Camera Extension(Swift) to observer application (obj-c++)
I use CMIOObjectAddPropertyListener for this kind of communication (of state changes from the extension to an app). That said, I'm surprised at this line [mObserverClassInstance subscribe:@(notification.c_str())]; because I thought @ could only be used with string literals, so you could write [mObserverClassInstance subscribe:@"VirtualCamUsageChanged"]; I've never seen @ used with a run-time expression.
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’24
Reply to USB HID Specifics for Mac OS?
how exactly do you determine that the joystick "does not work" on macOS? Joysticks are not directly supported by the OS, you need to have code that specifically looks for input from HID joysticks. Do you have such code? There's an old project on GitHub https://github.com/arsdraconis/HID-Explorer which needs a few changes to compile on modern macOS, but you may be able to use this to get more insights into how your device is treated by the OS. Also, see this post on Stack Overflow: https://stackoverflow.com/questions/41715074/simple-hid-osx-application, which refers to the open source parts of IOHIDFamily.
Topic: Graphics & Games SubTopic: GameKit Tags:
Mar ’24
Reply to MetalC++ is confusing
If you insist, Qt is a cross-platform C++ framework for app development which can target macOS. However, I think you're rowing against the tide here. Current documentation and online articles about macOS development lean towards Swift (ten years old) and SwiftUI (five years old), and Objective C. You can use C++ with ObjC code, just change the file extension from .m to .mm. I don't think it is possible to write any meaningful app without using a library of some sort. What exactly are you trying to avoid?
Topic: Graphics & Games SubTopic: General Tags:
Mar ’24
Reply to Problem with my files disappear in xcode
are you sure you have a ContentView.swift file on disk? You say "all my files were gone" but I only see one that Xcode can't find. Where does Xcode think it is? Click on the file ContentView in the file navigator on the left, open the inspectors panel on the right, select the File inspector (the first one). You'll see the Full Path - does it lead where you expect? If the file is present on disk, you can update the path by clicking the little rightward-pointing arrow in a circle next to the path and selecting the file in its actual location.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’24
Reply to Could not find the main bundle or the Info.plist is missing a CFBundleIdentifier
this looks a little odd to me: "Could not find the main bundle or the Info.plist is missing a CFBundleIdentifier in \U2018MyApp.productbuild.pkg\U2019."; because it is presenting the name of the package inside quoted Unicode LEFT SINGLE QUOTATION MARK and RIGHT SINGLE QUOTATION MARK. I'd expect plain quotation marks. Take a careful look at the contents of your scripts and make sure you're not copying a command line from a text editor (such as Word) that likes to convert written ' and " to curly quotes.
Mar ’24
Reply to How to achieve this gradient and the translucent text in SwiftUI?
something like this should get you started. You'd probably want to put any custom colors into an Asset, not hard-code them like this. All the colors I made here are transparent, so my white background shows through. I found many relevant samples quite quickly by searching the Internet for "SwiftUI gradient" and "SwiftUI custom color" and "SwiftUI filled rectangle". Did you do the same? If you didn't, you really should have... extension Color { static let pink = Color(red: 0.8, green: 0.0, blue: 0.0, opacity: 0.3) static let reddish = Color(red: 1.0, green: 0.0, blue: 0.0, opacity: 0.5) static let darkishRed = Color(red: 1.0, green: 0.0, blue: 0.0, opacity: 0.3) } let gradient = LinearGradient(gradient: Gradient(colors: [.pink, .reddish]), startPoint: .top, endPoint: .bottom) struct ContentView: View { var body: some View { ZStack { RoundedRectangle(cornerRadius: 10) .fill(gradient) .frame(width: 200, height: 200) Text("hello world") .font(.largeTitle) .foregroundStyle(Color.darkishRed ) } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’24