Post

Replies

Boosts

Views

Activity

Reply to Attribute Inspector
Do you have a storyboard or xib file open in your project? The attributes inspector works with storyboard and xib files. You have to open a storyboard or xib file to have access to the attributes inspector. If you select a source code file in the project, the attributes inspector won't be available. You can access the inspectors by choosing View > Inspectors.
Jun ’25
Reply to How to install codes from Playground on iPhone
I'm not sure if you are asking about running a playground on an iPhone or if you are asking about running an app you wrote with the Mac version of Swift Playgrounds on an iPhone. But the answer is the same either way. No, you won't be able to run your code on an iPhone. Swift Playgrounds is available for iPad and Mac, not iPhone. You are not going to be able to run playground code that is not an app on an iPhone. You could run the code on an iPad if you install the iPad version of Swift Playgrounds. The Mac version of Swift Playgrounds makes Mac Catalyst apps, a Mac version of an iPad app. You are not going to be able to run an app you make with the Mac version of Swift Playgrounds on an iPhone. My suggestion is to continue learning to code using Swift Playgrounds on Mac. When you are ready to make an iPhone app, create an iOS app project in Xcode.
Apr ’25
Reply to My first Xcode build ever But EXC_BAD_ACCESS (code=2, address=0x16e837f30) keeps happening
Your app is crashing. Unfortunately there's nothing in the code you showed that would cause a crash. You have /*@START_MENU_TOKEN@*/ and /*@END_MENU_TOKEN@*/ tokens in the code listing, but my guess is that's a copy paste error. Your project wouldn't build if those tokens were in your actual code. Add an exception breakpoint in Xcode. When your app crashes, Xcode will pause your project, showing you the code where the app crashed. In Xcode choose Debug > Breakpoints > Create Exception Breakpoint to add an exception breakpoint.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’25
Reply to Need iOS 18.3.2 Device Support Files for Xcode 14.3.1 on macOS Ventura 13.7.4
Apple stopped providing device support files, starting with iOS 17. There are no iOS 18 support files to add to your Xcode 14 install. According to the following article: https://hybridcattt.com/blog/debugging-on-latest-ios-with-older-xcode You can tell Xcode to not start debugging your project when it launches and attach to the debugger after the app launches. I have not tested this technique so I can't guarantee it will work. But it's the only alternative i know of to debug your project if you can't update to Xcode 16 and don't have an iOS 16 device to use with Xcode 14.
Mar ’25
Reply to how do I enable Save As in File menu in SwiftUI?
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.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’25
Reply to how do I enable Save As in File menu in SwiftUI?
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.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’25
Reply to About Xcode and GitHub
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/
Feb ’25
Reply to Multi Platform App
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/
Topic: UI Frameworks SubTopic: SwiftUI
Jan ’25
Reply to Struggling to add a test target to an existing project in Xcode
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.
Nov ’24
Reply to Creating UI instance using 'XML' like data at runtime
I don't know of any way to create UIKit controls with XML-like strings. In UIKit you can create the UI visually using a storyboard or create the UI in code.
Topic: UI Frameworks SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’25
Reply to Attribute Inspector
Do you have a storyboard or xib file open in your project? The attributes inspector works with storyboard and xib files. You have to open a storyboard or xib file to have access to the attributes inspector. If you select a source code file in the project, the attributes inspector won't be available. You can access the inspectors by choosing View > Inspectors.
Replies
Boosts
Views
Activity
Jun ’25
Reply to How do we build Intel compatible binary in Sequoia Xcode?
Archiving the project by choosing Product > Archive creates a binary with both Apple Silicon and Intel architectures for me on macOS 15.
Replies
Boosts
Views
Activity
May ’25
Reply to How to install codes from Playground on iPhone
I'm not sure if you are asking about running a playground on an iPhone or if you are asking about running an app you wrote with the Mac version of Swift Playgrounds on an iPhone. But the answer is the same either way. No, you won't be able to run your code on an iPhone. Swift Playgrounds is available for iPad and Mac, not iPhone. You are not going to be able to run playground code that is not an app on an iPhone. You could run the code on an iPad if you install the iPad version of Swift Playgrounds. The Mac version of Swift Playgrounds makes Mac Catalyst apps, a Mac version of an iPad app. You are not going to be able to run an app you make with the Mac version of Swift Playgrounds on an iPhone. My suggestion is to continue learning to code using Swift Playgrounds on Mac. When you are ready to make an iPhone app, create an iOS app project in Xcode.
Replies
Boosts
Views
Activity
Apr ’25
Reply to My first Xcode build ever But EXC_BAD_ACCESS (code=2, address=0x16e837f30) keeps happening
Your app is crashing. Unfortunately there's nothing in the code you showed that would cause a crash. You have /*@START_MENU_TOKEN@*/ and /*@END_MENU_TOKEN@*/ tokens in the code listing, but my guess is that's a copy paste error. Your project wouldn't build if those tokens were in your actual code. Add an exception breakpoint in Xcode. When your app crashes, Xcode will pause your project, showing you the code where the app crashed. In Xcode choose Debug > Breakpoints > Create Exception Breakpoint to add an exception breakpoint.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’25
Reply to Request for basic GCVirtualController example code
The following article has a link to a GitHub project that moves a sprite around the screen with a virtual controller: https://checksimgames.com/using-virtual-controllers-in-an-ios-game/
Replies
Boosts
Views
Activity
Apr ’25
Reply to Need iOS 18.3.2 Device Support Files for Xcode 14.3.1 on macOS Ventura 13.7.4
Apple stopped providing device support files, starting with iOS 17. There are no iOS 18 support files to add to your Xcode 14 install. According to the following article: https://hybridcattt.com/blog/debugging-on-latest-ios-with-older-xcode You can tell Xcode to not start debugging your project when it launches and attach to the debugger after the app launches. I have not tested this technique so I can't guarantee it will work. But it's the only alternative i know of to debug your project if you can't update to Xcode 16 and don't have an iOS 16 device to use with Xcode 14.
Replies
Boosts
Views
Activity
Mar ’25
Reply to how do I enable Save As in File menu in SwiftUI?
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.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to how do I enable Save As in File menu in SwiftUI?
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.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to Navigation split view selection property is set to nil when selecting list item
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.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Feb ’25
Reply to Command Line Tool Embedding in SwiftUI App
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.
Replies
Boosts
Views
Activity
Feb ’25
Reply to About Xcode and GitHub
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/
Replies
Boosts
Views
Activity
Feb ’25
Reply to Can't use same name for same app on different platforms
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.
Replies
Boosts
Views
Activity
Feb ’25
Reply to Multi Platform App
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/
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Jan ’25
Reply to Struggling to add a test target to an existing project in Xcode
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.
Replies
Boosts
Views
Activity
Nov ’24