Post

Replies

Boosts

Views

Activity

Improving the transition between ultra wide and wide angle lens
I'm building an app which uses the camera and want to take advantage of the ability of the builtInTripleCamera and builtInDualWideCamera to automatically switch between the ultra wide and wide angle lens to focus on close up shots. It's working fine - except that the transition between the two lenses is a bit jumpy. I looked at what the native Camera app does and it seems to apply a small amount of blurring when the transition happens to help "mask" the jumpiness. How can I replicate this, or is there another way to improve the UX of switching between one lens and another automatically?
1
0
147
1w
Unable to reset simulators
I'm unable to reset simulators using the menu or the xcrun simctl tool: <output of xcrun simctl list> == Devices == -- iOS 17.5 -- iPhone SE (3rd generation) (5A06623A-173D-4C96-8DD3-3E9FE39A06F1) (Shutdown) iPhone 15 (iOS 17.5) (F4329E8D-29BB-4EA7-8465-C11A98D04ED7) (Shutdown) -- iOS 18.0 -- iPhone SE (3rd generation) (2DDE8F03-F8E1-4C1B-8E28-CD9B208F3FFA) (Shutdown) iPhone 16 Pro (DE788688-8AC6-40A0-B25C-A56AA423798E) (Shutdown) iPhone 16 Pro Max (1405184C-36A9-40F3-B0D0-4EEB88452883) (Shutdown) iPhone 16 (0CBBA7DB-B20E-4F17-BBC5-910F1F6E1A0A) (Shutdown) iPhone 16 Plus (95421C27-11A0-4FCF-A889-DAAE8557B271) (Shutdown) == Device Pairs == ~/Library`` ❯ xcrun simctl erase 0CBBA7DB-B20E-4F17-BBC5-910F1F6E1A0A An error was encountered processing the command (domain=NSCocoaErrorDomain, code=513): “data” couldn’t be moved because you don’t have permission to access “Deleting-8FEDFF47-5B2F-4534-BCA2-036BBE68CE37”. You don’t have permission. To view or change permissions, select the item in the Finder and choose File > Get Info. Underlying error (domain=NSPOSIXErrorDomain, code=1): The operation couldn’t be completed. Operation not permitted Operation not permitted Xcode Version 16.0 (16A242d) MacOS 15.0.1 (24A348)
3
2
656
Oct ’24
AppIntents - Choosing a default Measurement<UnitMass> for body weight based on locale
Here’s a clearer and more concise version of your question: I’m creating an AppIntent to allow users to log their body weight. My intent includes a @Parameter defined as: @Parameter( title: "Weight", description: "Current Weight", defaultUnit: .pounds, supportsNegativeNumbers: false ) var weight: Measurement<UnitMass> This works but doesn’t respect the user’s Locale and its measurementSystem. When I add defaultUnitAdjustForLocale: true to the @Parameter macro, the default always switches to kilograms, regardless of the locale. How can I correctly set the default unit to match the user’s locale for the purpose of entering a users body weight?
0
0
230
Jan ’25
OpenURLIntent to custom url scheme
Has anyone figured out how to use the new OpenURLIntent intent to open their own app using a custom URL scheme? I have the following code: @available(iOS 18, *) struct BarcodeScannerControlWidget: ControlWidget { var body: some ControlWidgetConfiguration { StaticControlConfiguration(kind: "scannerIntent") { ControlWidgetButton(action: OpenBarcodeScannerIntent()) { Label("Scan Barcode", systemImage: "barcode.viewfinder") } } .displayName("Scan Barcode") } } @available(iOS 18, *) struct OpenBarcodeScannerIntent: AppIntent { static var title: LocalizedStringResource = "Scan Barcode" func perform() async throws -> some IntentResult & OpensIntent { let url = "myscheme:///barcodeScanner let openURLIntent = OpenURLIntent(url) return .result(opensIntent: openURLIntent) } } Running this intent doesn't seem to do anything. If I replace the URL with say "https://www.apple.com", the intent opens up safari with that URL.
4
3
1.3k
Aug ’24