Post

Replies

Boosts

Views

Activity

Reply to internal and external USB device list
what makes you think there are any internal USB devices? Which devices do you think are missing? Why do you need the information? If you can't do anything with the device (because it is proprietary, and can only be accessed over the higher-level interfaces provided by Apple), why would you care about it?
Topic: App & System Services SubTopic: Drivers Tags:
Apr ’24
Reply to xcrun: error: missing DEVELOPER_DIR path: /Applications/Xcode14.app/Contents/Developer
The path to the developer directory is /Applications/Xcode.app/Contents/Developer, not ...Developers. (no 's' on the end). You do need to point at an existing directory. If you are using Xcode 14, and you renamed it Xcode14, your command should be xcode-select --select /Applications/Xcode14.app/Contents/Developer When you install command line tools, they are installed into the currently-selected Xcode. You are saying "my command line tools in Xcode are Xcode 15.3". Which Xcode do you want to use? You said you switched from Xcode 13 to Xcode 15, but you're using Xcode 14 - which is it? You can use multiple Xcode versions on one machine, but you have to be careful about running multiple xcodebuild commands at the same time if you want to target different tools, because the xcode-select command is system-wide. If you launch Xcode from Finder, you'll use the one you launch, you don't need to set anything. If you run xcodebuild at the command line, it will use the selected Xcode, which by default is the one in /Applications/Xcode. I usually make sure that the Xcode I use on a daily basis is actually called "Xcode", and any beta or previous versions I have lying around have a different name. It sounds like your build script is specifically looking for an app called "Xcode14". Maybe whoever wrote it named their Xcode "Xcode14". That's fine, but then you have to do the same thing (which is pretty strange if you're actually using Xcode 15), or change the build script. I know what I'd do...
Apr ’24
Reply to Bundle ID and Certificates
if you change the bundle ID in your Xcode target, and select "Automatically manage signing", Xcode will create the required certificate. If you're not requesting any managed entitlements, and it sounds like you are not, you wont' need a provisioning profile. If your app wants to save to disk, and it is sandboxed (which is a requirement for a Mac App Store app), you'll need to add an entitlement to punch through the sandbox - that's under Signing & Capabilities, File Access Type, User Selected File. When you archive your app in Xcode, it will lead you through the process and pick the correct type of certificate for the distribution method you choose.
Topic: Code Signing SubTopic: General Tags:
Apr ’24
Reply to Making the macOS sidebar visible again
have you tried using NavigationSplitView. The code below puts a disclosure button in the toolbar area (on the right, close to the traffic light buttons), and a hide/show menu item in the menu bar, as appropriate. No need to mention the toolbar button explicitly. struct ContentView: View { var body: some View { NavigationSplitView { SidebarView() } detail: { DetailView() } } } struct SidebarView: View { var body: some View { Text("sidebar") } } struct DetailView: View { var body: some View { Text("detail") } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’24
Reply to How to get realtime headphone levels in decibel unit
dB relative to what? If you're interested in the SPL the user experiences, that's going to depend on the headphone sensitivity. Even the delivered power isn't very helpful: https://developer.apple.com/documentation/avfoundation/avcaptureaudiochannel/1387368-averagepowerlevel says "averagePowerLevel The instantaneous average power level in decibels." How a measurement can be both average (implying a series of measurements over time) and instantaneous is baffling to me, while a measurement in decibels without a reference power level is also, let's just say non ideal.
Topic: Media Technologies SubTopic: Audio Tags:
Apr ’24
Reply to Animates wrongly at every switch of direction, animates right in same direction
SwiftUI remembers the "old" view in order to perform a transition to the "new" view. When you reverse direction, the outgoing view is still associated with a transition going in the (now) wrong direction. My fix is to immediately change the direction when you press the button. This causes body() to be re-invoked, but no transition is visible because the view ID of the question has not changed. Subsequently, a Task alters the view ID, which causes a transition from the old question (now associated with a removal transition in the new direction) to the new question. I think this solution smells a little, because it is imperatively driving the UI, and because I have no idea when the Task closures will actually be invoked. No doubt after the Button's action closure, but are they guaranteed to be invoked before any subsequent UI action? I don't know. I changed QuizView to ContentView to get it to compile in my test app. import SwiftUI struct Question { let id: Int let text: String } extension AnyTransition { static var slideRight: AnyTransition { let insertion = AnyTransition.move(edge: .trailing) let removal = AnyTransition.move(edge: .leading) return .asymmetric(insertion: insertion, removal: removal) } static var slideLeft: AnyTransition { let insertion = AnyTransition.move(edge: .leading) let removal = AnyTransition.move(edge: .trailing) return .asymmetric(insertion: insertion, removal: removal) } } struct ContentView: View { let questions = [ Question(id: 1, text: "11111111111"), Question(id: 2, text: "222222222222222222222222"), Question(id: 3, text: "3333333333333333333"), Question(id: 4, text: "444444444444444444444444"), Question(id: 5, text: "55555555555555555555"), Question(id: 6, text: "6666666666666666666666666") ] @State private var currentQuestionIndex = 0 @State private var navigationDirection: NavigationDirection = .forward var body: some View { VStack(spacing: 20) { Text(questions[currentQuestionIndex].text) .id(questions[currentQuestionIndex].id) // Important for transition .transition(navigationDirection == .forward ? .slideRight : .slideLeft) .frame(maxWidth: .infinity, maxHeight: .infinity) HStack { Button("Previous") { moveToPreviousQuestion() } .disabled(currentQuestionIndex == 0) Spacer() Button("Next") { moveToNextQuestion() } .disabled(currentQuestionIndex == questions.count - 1) } } .padding() .animation(.easeInOut(duration: 1.0), value: currentQuestionIndex) } private func moveToNextQuestion() { if currentQuestionIndex < questions.count - 1 { if navigationDirection == .backward { navigationDirection = .forward } Task { currentQuestionIndex += 1 } } } private func moveToPreviousQuestion() { if currentQuestionIndex > 0 { if navigationDirection == .forward { navigationDirection = .backward } Task { currentQuestionIndex -= 1 } } } } enum NavigationDirection { case forward, backward }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’24
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