I don't know how to have the Save As menu appear all the time in a SwiftUI app.
The Save panel appears only the first time you save a document when choosing File > Save. After that there's no need for a Save panel when you choose File > Save because the OS knows the name and location of the document.
Post
Replies
Boosts
Views
Activity
On Mac you have to hold down the Option key to make the Save As menu item appear in the File menu.
The Save As menu item is meant for saving the current document with a different file name. The menu item doesn't have anything to do with multiple content types. If you have multiple writable content types, the Save panel has a menu to choose the file type to use to save the document when you choose File > Save. You don't need the Save As menu item to specify a file type for a saved document.
Your changes solved my issue. Thank you.
I didn't mention it in my question, but the app is document-based so each window will have its own wiki.
i have tried multiple solutions but i am unable to resolve this issue
List the solutions you tried so people do not suggest things you tried.
Go into more detail on how you prepared Xcode for GitHub.
What you normally do to put an Xcode project on GitHub is to create a git repository for your project by choosing Source Control > New Git Repository and creating an external branch for GitHub from Xcode's source control navigator, which you can access by pressing Cmd-2.
When you put your project on GitHub like I described in the previous paragraph, you don't have to clone the project on GitHub.
It sounds like you have two versions of your project locally: the one you originally created and the one you cloned from GitHub. You have two options:
Work with the project you cloned from GitHub and stop using the one you originally created.
Place your original project on GitHub and stop using the cloned version.
The following article shows how to put a local Xcode project on GitHub:
swiftdevjournal.com/putting-your-xcode-project-on-github-bitbucket-or-gitlab/
I had the same issue recently. When I asked App Review for a suitable name for the Mac version, they suggested using Desktop instead of Mac for the Mac version of the app.
In your case go with Cloud Snippets Desktop for the Mac version.
Xcode has a multi-platform app project template that gives you one app target with destinations for iOS, iPad, and Mac. Use this template if you want people to have access to all three versions with one purchase. Create separate targets if you want to require separate purchases to access each person.
Regarding the views, if you have separate targets, you can create view files that apply to a specific target. A Mac version of the view would be part of the Mac app target but not the iOS version.
If you go with the multiplatform-app template, you can create view files that apply to only one platform. Go to the target's Compile Sources build phases and specify the platforms to build for. More details about the multi-platform app template are in the following article:
swiftdevjournal.com/xcode-multiplatform-app-targets/
What version of Xcode are you running?
Can you run the unit tests if you create a new project and select the Include Tests checkbox?
Does your multi-platform project have one target with multiple destinations or separate targets for iOS and Mac?
If your project has separate targets, which target is your unit test running, the iOS or Mac version?
I was unable to reproduce your issue. I noticed when adding a Unit Test Bundle target to a project with multiple app targets that I had to choose an app target for the unit test bundle. Make sure you have the scheme set to run the app target that matches the target the test bundle is configured to run.
If you recently created your project, you may find it easier to create a new project that includes unit test targets and add whatever code from the first project to the new project.
The problem with your app not being able to find the audio files most likely has nothing to do with your code.
Are the audio files in the Resources folder in the app bundle? If they are not, your code will not be able to find and load them.
Make sure the audio files are in the app target's Copy Bundle Resources build phase. The files must in this build phase to get copied to the Resources folder in the app bundle when you build the project.
Take the following steps to look at the files in the Copy Bundle Resources build phase.
Open the project editor by selecting the project file from the left side of the project window.
Select the app target from the target list on the left side of the project editor.
Click the Build Phase button at the top of the project editor.
Click the disclosure triangle next to the Copy Bundle Resources build phase.
If your audio files are not in the Copy Bundle Resources build phase, click the Add button below the list of files to open a sheet where you can choose the files to add to the build phase.
Why do you want to use an older version of the macOS SDK?
If you want your app to run on older versions of macOS, you can set the deployment target of the app to a lower version. The deployment target is the earliest version of macOS that can run your app. You can change the deployment target by taking the following steps:
Select your project from the left side of the project window to open the project editor.
Select your app target from the target list on the left side of the project editor.
Click the General button at the top of the project editor.
Use the menu in the Minimum Deployments section to choose the minimum macOS version for the app.
To save images in a rich text document, you need to save the file as an RTFD file. An RTFD file is an RTF file with support for attachments, such as image files.
You set the document type to RTF in the createRTFWithEmbeddedImage function.
[.documentType: NSAttributedString.DocumentType.rtf])
If you change the document type to NSAttributedString.DocumentType.rtfd, the file should save as an RTFD file.
I have not tried saving an attributed string with an image to a file so I can't guarantee there isn't more you have to do to get the image to save. But saving the file as RTFD is a start.
You are doing a lot in the .onChange block. To fix the compiler error, I recommend creating a function to calculate the value of P_Sprint and call the function in the .onChange block. Breaking up the calculations into smaller chunks will also help you fix the compiler error and make the code easier to understand.
If the code was working in Xcode 15.2 and you want to publish your app without making the code changes, then install Xcode 15.2. Build, archive, and submit your project in Xcode 15.2. Apple doesn't require Xcode 15.3 for App Store submissions.
Use the site Xcode Releases to find Apple's download links for all Xcode versions.
https://xcodereleases.com
No one can give you an answer until you show the code that is causing the compiler error.
Use the FileWrapper class to store your document as a package of files and folders that appears as a single file in the Finder. The following article provides an introduction to working with file wrappers in a SwiftUI app:
https://www.swiftdevjournal.com/using-file-wrappers-in-a-swiftui-app/
The following article shows ways to get around your issue.
https://www.swiftdevjournal.com/dealing-with-failed-to-prepare-device-for-development-error-message-in-xcode/
If the workarounds in that article don't work, you will need to find a device running an older version of iOS to run your project on your Mac.