Post

Replies

Boosts

Views

Activity

Reply to How to create a second target for an app with a linked App Clip?
Here's how to fix it... In the target for the Test Flight App in the general tab you'll find a framework, library, clips section and this contains the reference to the clip ( a relic of copying the original production target.) This must be deleted. However, you cannot delete it here (if you try, you'll get warning popups etc but the deletion fails. ) Instead, navigate to the Build Phases tab and scroll down to the Embed App Clips section and here you can delete it. Warning: Make sure you do this in the test flight target not the production target.
1w
Reply to Run identical UI/Unit tests on different build targets
I discovered this nugget of Apple Documentation. It visualises how the scheme is the link specifying which build target is used by the test target. Unfortunately this doesn't seem to be the case. The host application field in the test target (general tab) appears to be the main determinator. So my assumptions above seem to be correct, and you can be easily be misled into assuming one build target is used whereas in fact another target is used. Tip: Include a screenshot of the about page of your app/clip/widget to avoid being misled.
Nov ’24
Reply to NSCocoaErrorDomain 513
I'm also getting a 513 error no matter what I code. I even tried using chatGTP and Harmony and Copilot generated code. All to no avail. Here's the copilot code (as it seemed better to me) func copilotCreateTheNewDirectory(in downloadsURL: URL) { guard downloadsURL.startAccessingSecurityScopedResource() else { let errorMessage = "Failed to access the selected location" showError = true return } defer { downloadsURL.stopAccessingSecurityScopedResource() } let newDir = "myShinyNewDir" let fileManager = FileManager.default let newDirectoryURL = downloadsURL.appendingPathComponent(newDir) do { try fileManager.createDirectory( at: newDirectoryURL, withIntermediateDirectories: false, attributes: nil ) } catch { let errorMessage = "Failed to create directory: \(error.localizedDescription)" showError = true } } } I tried using Swift5 instead of Swift6 and that failed, too. I tried in Documents and Downloads locations - all failed. Here are my App Sandbox settings: Xcode: Version 16.0 (16A242d) MacOS: Sequoa 15.0.1
Nov ’24
Reply to Struggling with Swift Gesture/Observation
I compiled this using Xcode 16RC 16A242 (instead of 15) and it now just about works. In iPadOS 18RC it works perfectly. In iOS 17.6.1 the swipe does not react when started from on top of the button but the showTab2 property does not change either so it remains consistent. It seems this is a problem in Xcode 15 but it has been fixed in Xcode 16 as Sydney 🙏 suggested. PS: 🏆Kudus to Xcode Cloud for making this test so easy to perform. I'd never used it before and it was truly simple to onboard.
Sep ’24
Reply to Struggling with Swift Gesture/Observation
Hi Sydney, Xcode Version 15.4 (15F31d) Swift 5 (according to the build settings) I'm surprised, but can't figure yet how to update to 5.1. The code is running on the simulator (iPhone 15) and also iPadOS 18.0 (22A3354) iPad Air and iOS 17.6.1 on an iPhone 13 Pro. I checked all gesture attributes and couldn't find anything dodgy about them. Here's the video: https://youtube.com/shorts/SVlESw5nGX0?si=5JCUgu2iYBCh9Smk Thanks for your interest, Alan
Sep ’24
Reply to How to preview a custom View that takes bindings as inputs in its initializer?
I used Rob the Artist's solution in a different context and it worked perfectly. I was struggling with how to inject a @Namespace in a class that required initialisation into the preview. I'm a newbie so much appreciated the simplicity of the solution. #Preview { struct RectButtonPreview: View { @Namespace var slideLevel var body: some View { RectButtonView(buttonCol: .blue, selected: true) .environment(SlideAnimations(slideLevel: slideLevel)) } } return RectButtonPreview() }
Jul ’24