Post

Replies

Boosts

Views

Activity

Reply to Looking for hints on swiftui camera app.
To apply a CIFilter to your photo, you first need to create a CIImage from your saved photo. You could use the init?(contentsOf: url) initializer for this. Then you can perform CIFilter operations on the CIImage. To produce a new picture that you can save, you'll need to make a CIContext (with no destination), then use e.g. CIContext.createCGImage:fromRect I've found these extensions to be useful: https://github.com/DigitalMasterpieces/CoreImageExtensions Search for "write CGImage to file" for hints on how to do that. Note that neither CIImage nor CGImage are files, nor are they bitmap representations of images; they are abstract representations of "things that can be represented as an image" by their respective frameworks. Good luck!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’23
Reply to should an AVPlayer work in a Camera Extension?
You're right (an AVPlayer would have to run in the application). Thank you for reminding of this post. After much experimentation, I ended up using two AVAssetReaders. Unlike the AVAssetImageGenerator, an AVAssetReader can maintain state. Unlike AVPlayer, an AVAssetReader doesn't need to run in an application context. I use two so I can ping-pong between them to enable seamless transitions from the last frame of the movie back to the first. I want to do the compositing inside the extension because the composited video is the output of the virtual camera, which should work without running the hosting app.
Topic: Code Signing SubTopic: General Tags:
Aug ’23
Reply to XCODE PROBLEM
you may also have run into a situation where the IDE is not showing the program's output. In the screenshot you posted, the output is not shown. While (or after) running the program, disclose the output pane by clicking on the little disclosure button. It the furthest right button on the bottom of your screenshot.
Aug ’23
Reply to dSYM using xcodebuild
A .app bundle is not an executable, it is a folder with a specific structure. The executable code is in the bundle's Contents/MacOS directory. You don't want to add anything to that. You could put the symbol file into the bundle you distribute to users, but there is really no reason to do so. It is just dead weight to users, it is only useful to you. If you really want to put it into the bundle, you could copy it to some location in the bundle before signing and notarization. You'd do this by adding a post-build script to the Build Phases of your target in Xcode. A more reasonable approach is to simply archive the .dSYM files for every release you make, and use the appropriate dSYM when you receive a crash log. You can symbolicate the crash logs by hand or using Xcode. See https://developer.apple.com/documentation/xcode/adding-identifiable-symbol-names-to-a-crash-report
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’23
Reply to WWDC2023 "Support external cameras in your iPadOS app" presentation sample code
I haven't found the modified sample, but you can download the original code (linked in the WWDC video description) and modify it by following the instructions in the video. At least the slide showing how to preferentially detect and use an external camera is visible for a few seconds, I haven't bothered with the rest yet (which deal with hot plugging etc). It is a couple of lines of code to changes to get a picture from your external camera.
Topic: App & System Services SubTopic: Core OS Tags:
Jul ’23
Reply to Problem when working with .onChange and .onAppear modifier
you haven't shown code complete enough for anyone to reproduce your problem. Try to reduce the problem to a minimum (maybe in a new project), then repost if need be. You'll probably find that you'll figure it out yourself by performing the reduction. What does "showAlert" do? What do you mean by "the issue is in the .onAppear modifier"? It doesn't compile, it is never executed, it behaves in some other way you don't expect - what?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’23
Reply to How to update macOS Beta on VM devices
why are you using a VM, and what are you testing with it, and how? I gave up on using VMs because of the inability to sign into iCloud on a VM, and because it really didn't seem to save any time. I wanted to test the first-time-install experience for our software, which seems impossible to replicate without starting with a new OS and a new user account. It seems to take just as long to reinstall the OS on a VM as it does to reinstall the OS on a physical partition. So that's what I do now - I install beta OSs on a partition of an external drive, and boot a second laptop from that (so that I can continue to use my development machine for other tasks like email and Slack). I often need to debug behavior on the new OS, so I have to install Xcode on that new OS, which also takes its sweet time. I put the beta OS on an external disk, and use a second laptop booted from that disk as my test machine. I'd really like to hear how other people are using VMs for testing their software, and how that experience is better than using a separate Mac and/or a separate boot partition.
Jul ’23
Reply to Looking for hints on swiftui camera app.
To apply a CIFilter to your photo, you first need to create a CIImage from your saved photo. You could use the init?(contentsOf: url) initializer for this. Then you can perform CIFilter operations on the CIImage. To produce a new picture that you can save, you'll need to make a CIContext (with no destination), then use e.g. CIContext.createCGImage:fromRect I've found these extensions to be useful: https://github.com/DigitalMasterpieces/CoreImageExtensions Search for "write CGImage to file" for hints on how to do that. Note that neither CIImage nor CGImage are files, nor are they bitmap representations of images; they are abstract representations of "things that can be represented as an image" by their respective frameworks. Good luck!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’23
Reply to should an AVPlayer work in a Camera Extension?
You're right (an AVPlayer would have to run in the application). Thank you for reminding of this post. After much experimentation, I ended up using two AVAssetReaders. Unlike the AVAssetImageGenerator, an AVAssetReader can maintain state. Unlike AVPlayer, an AVAssetReader doesn't need to run in an application context. I use two so I can ping-pong between them to enable seamless transitions from the last frame of the movie back to the first. I want to do the compositing inside the extension because the composited video is the output of the virtual camera, which should work without running the hosting app.
Topic: Code Signing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’23
Reply to Recreating the Xcode style value input
clicking and dragging: use a .gesture modifier on a view click to enter a number: that's the behavior of a TextField change cursor on hover: onContinuourHover and the methods on NSCursor should get you started
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’23
Reply to XCODE PROBLEM
you may also have run into a situation where the IDE is not showing the program's output. In the screenshot you posted, the output is not shown. While (or after) running the program, disclose the output pane by clicking on the little disclosure button. It the furthest right button on the bottom of your screenshot.
Replies
Boosts
Views
Activity
Aug ’23
Reply to CoreMediaIO camera extension not available immediately after activation
are you saying if you run a AVCaptureDevice.DiscoverySession, you don't see your extension becoming available as a new AVCaptureDevice? That has not been my experience. Once the AVCaptureDevice has appeared, I can find and talk to its corresponding CMIO object.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Aug ’23
Reply to Unable to install Command Line Developer Tools
go to developer.apple.com, click on Develop, then Downloads. That should take you to developer.apple.com/downloads. Click on the More link in the top right, then search for "command line tools"
Replies
Boosts
Views
Activity
Aug ’23
Reply to kIOMessageDeviceWillPowerOff notification doesn't work as expected
Do you really want to know when the display is turned OFF (by a user)? Because you're register for a notification called CBDisplaySleep, so I'm a little confused. If the user turns the display off, it disappears from the system. You'd need to monitor for changes in the IORegistry topology to see that.
Topic: App & System Services SubTopic: Drivers Tags:
Replies
Boosts
Views
Activity
Aug ’23
Reply to dSYM using xcodebuild
A .app bundle is not an executable, it is a folder with a specific structure. The executable code is in the bundle's Contents/MacOS directory. You don't want to add anything to that. You could put the symbol file into the bundle you distribute to users, but there is really no reason to do so. It is just dead weight to users, it is only useful to you. If you really want to put it into the bundle, you could copy it to some location in the bundle before signing and notarization. You'd do this by adding a post-build script to the Build Phases of your target in Xcode. A more reasonable approach is to simply archive the .dSYM files for every release you make, and use the appropriate dSYM when you receive a crash log. You can symbolicate the crash logs by hand or using Xcode. See https://developer.apple.com/documentation/xcode/adding-identifiable-symbol-names-to-a-crash-report
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’23
Reply to WWDC2023 "Support external cameras in your iPadOS app" presentation sample code
sorry, no idea, that's the only modification I made.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to macbook pro 16" screen stopped working after installing Ventura Version 13.5 Beta (22G5072a)
If you have access to another Mac, you can use Apple Configurator 2 (from the App Store) to re-install the OS from a restore image, available here: https://developer.apple.com/download/. Maybe that will fix it.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to WWDC2023 "Support external cameras in your iPadOS app" presentation sample code
I haven't found the modified sample, but you can download the original code (linked in the WWDC video description) and modify it by following the instructions in the video. At least the slide showing how to preferentially detect and use an external camera is visible for a few seconds, I haven't bothered with the rest yet (which deal with hot plugging etc). It is a couple of lines of code to changes to get a picture from your external camera.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to Problem when working with .onChange and .onAppear modifier
you haven't shown code complete enough for anyone to reproduce your problem. Try to reduce the problem to a minimum (maybe in a new project), then repost if need be. You'll probably find that you'll figure it out yourself by performing the reduction. What does "showAlert" do? What do you mean by "the issue is in the .onAppear modifier"? It doesn't compile, it is never executed, it behaves in some other way you don't expect - what?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to How to update macOS Beta on VM devices
why are you using a VM, and what are you testing with it, and how? I gave up on using VMs because of the inability to sign into iCloud on a VM, and because it really didn't seem to save any time. I wanted to test the first-time-install experience for our software, which seems impossible to replicate without starting with a new OS and a new user account. It seems to take just as long to reinstall the OS on a VM as it does to reinstall the OS on a physical partition. So that's what I do now - I install beta OSs on a partition of an external drive, and boot a second laptop from that (so that I can continue to use my development machine for other tasks like email and Slack). I often need to debug behavior on the new OS, so I have to install Xcode on that new OS, which also takes its sweet time. I put the beta OS on an external disk, and use a second laptop booted from that disk as my test machine. I'd really like to hear how other people are using VMs for testing their software, and how that experience is better than using a separate Mac and/or a separate boot partition.
Replies
Boosts
Views
Activity
Jul ’23
Reply to Make a new Xcode target that's a copy of an existing one
click on the project in the navigator on the right, to expose the list of targets in the editor. Right click on the target you want to duplicate, and select "Duplicate".
Replies
Boosts
Views
Activity
Jun ’23
Reply to AppleScript. How do I get a list of all files in all subfolders without any conditions?
I don't understand your question "what is the name of what you proposed?". I proposed that you use the 'ls' command, rather than 'find'. Once again, what are you trying to do?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jun ’23