Post

Replies

Boosts

Views

Activity

Reply to How can I update my app to make it compatible with older ios versions?
Set the deployment target for the app's target to the earliest iOS version you want to support. Select the project file from the project navigator on the left side of the project window to access the deployment target. If you need more detailed instructions on setting the deployment target, read the following article: https://www.swiftdevjournal.com/supporting-older-versions-of-ios-and-macos/
Topic: Safari & Web SubTopic: General Tags:
Jul ’22
Reply to Fatal Error: UIViewControllerRepresentables must be value types: ViewControllerResolver
Does your app use UIViewControllerRepresentable? If so, is your data structure that uses UIViewControllerRepresentable a struct or a class? The error message is saying you have a class that conforms to UIViewControllerRepresentable, and that you have to use a struct instead of a class. Setting an exception breakpoint in Xcode and running the app can help you find where the app is crashing. Choose Debug > Breakpoints > Create Exception Breakpoint to set an exception breakpoint.
Jun ’22
Reply to Unable to pass down returned value from one view to another
What is the specific problem you are having? What are you expecting to happen when you tap the Add button and what happens when you tap the Add button? I looked at your code for the navigation bar items. The navigation link for the Add button passes an empty note to the note view with an empty ID before you have a chance to call addNote and get the new note's ID. You may have to create a new view for adding notes and show that when someone taps the Add button. Add the note when someone taps an Add button in the Add Note view. Your DataManager class refers to a Note struct or class. Why do you have separate @State properties for the note contents and ID in the NoteView struct instead of a Note instance? Your addNote function could return the note instead of the ID. I think it would be easier to deal with notes than to deal with their individual pieces separately.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’22
Reply to Could not load NIB in bundle
Are you getting this error when running your app in Xcode? If so, you're getting the error because you're running a newer version of tvOS than Xcode 13.1 supports. Xcode 13.1 does not support any versions of tvOS newer than 15.2. You have two options: update Xcode to Xcode 13.3 or 13.4 or downgrade to tvOS 15.2. I'm not sure if it's possible to downgrade to an older version of tvOS. If you are still getting the error after updating Xcode, you will have to show your code to load the storyboard from the app bundle and show the layout of your app bundle for anyone to help you. Are you sure the storyboard is in the app bundle? Is the storyboard in the app bundle location where the storyboard loading code is expecting it?
Topic: App & System Services SubTopic: Core OS Tags:
May ’22
Reply to About page
Is this for iOS or Mac? For Mac I can answer. In Xcode choose File > New > File and add a RTF file to your project. Name the file Credits.rtf. Edit the files with what you want to appear in the About box. You can find additional information in the following article: https://www.swiftdevjournal.com/customizing-the-about-box-in-your-mac-app/
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’22
Reply to Do I have to be a paid developer to develop MacOS programs for personal use?
You do not need a paid developer account to develop Mac apps for personal use. You need a paid account to do the following: Submit an app to the Mac App Store Use Apple capabilities like iCloud and Game Center Sign and notarize your app with a developer ID to work with Apple's Gatekeeper feature Gatekeeper makes it painful to open apps that aren't notarized. Without a paid developer account you won't be able to notarize your apps. Your options are to rebuild the apps periodically or bypass Gatekeeper. The following article shows how to bypass Gatekeeper for a single app: https://disable-gatekeeper.github.io
Topic: Code Signing SubTopic: General Tags:
May ’22
Reply to SwiftUI NSOpenPanel runs but then crashes Mac app
The fileOpenDialog function returns an array of optional URLs. What does that function return when you call it? The following line is going to crash if the array is empty: var csvURLString = fileOpenDialog()[0]?.path SwiftUI has a fileImporter modifier that shows an Open panel so you can avoid using NSOpenPanel. Searching for swiftui fileimporter in a search engine brings up several articles on using the file importer. If you still want to use NSOpenPanel with SwiftUI, the following article may help you: https://serialcoder.dev/text-tutorials/macos-tutorials/save-and-open-panels-in-swiftui-based-macos-apps/
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’22
Reply to How can I update my app to make it compatible with older ios versions?
Set the deployment target for the app's target to the earliest iOS version you want to support. Select the project file from the project navigator on the left side of the project window to access the deployment target. If you need more detailed instructions on setting the deployment target, read the following article: https://www.swiftdevjournal.com/supporting-older-versions-of-ios-and-macos/
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to Fatal Error: UIViewControllerRepresentables must be value types: ViewControllerResolver
Does your app use UIViewControllerRepresentable? If so, is your data structure that uses UIViewControllerRepresentable a struct or a class? The error message is saying you have a class that conforms to UIViewControllerRepresentable, and that you have to use a struct instead of a class. Setting an exception breakpoint in Xcode and running the app can help you find where the app is crashing. Choose Debug > Breakpoints > Create Exception Breakpoint to set an exception breakpoint.
Replies
Boosts
Views
Activity
Jun ’22
Reply to Unable to pass down returned value from one view to another
What is the specific problem you are having? What are you expecting to happen when you tap the Add button and what happens when you tap the Add button? I looked at your code for the navigation bar items. The navigation link for the Add button passes an empty note to the note view with an empty ID before you have a chance to call addNote and get the new note's ID. You may have to create a new view for adding notes and show that when someone taps the Add button. Add the note when someone taps an Add button in the Add Note view. Your DataManager class refers to a Note struct or class. Why do you have separate @State properties for the note contents and ID in the NoteView struct instead of a Note instance? Your addNote function could return the note instead of the ID. I think it would be easier to deal with notes than to deal with their individual pieces separately.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Where do I learn how to make a game?
The book Apple Game Frameworks and Technologies will teach you how to make an iOS game with SpriteKit and GameplayKit. It does require some previous programming knowledge. https://pragprog.com/titles/tcswift/apple-game-frameworks-and-technologies/
Topic: Graphics & Games SubTopic: GameKit Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to How can i migrate a project from playground to Xcode or Xcode to playground(or, updating it using Xcode/playground)?
You can open an App playground created in Swift Playgrounds in Xcode and work on it there. The Swift Playgrounds App project template in Xcode is designed to work in both Xcode and Swift Playgrounds. The Swift Playgrounds App project template is in the iOS section of the New Project Assistance.
Replies
Boosts
Views
Activity
Jun ’22
Reply to Could not load NIB in bundle
Are you getting this error when running your app in Xcode? If so, you're getting the error because you're running a newer version of tvOS than Xcode 13.1 supports. Xcode 13.1 does not support any versions of tvOS newer than 15.2. You have two options: update Xcode to Xcode 13.3 or 13.4 or downgrade to tvOS 15.2. I'm not sure if it's possible to downgrade to an older version of tvOS. If you are still getting the error after updating Xcode, you will have to show your code to load the storyboard from the app bundle and show the layout of your app bundle for anyone to help you. Are you sure the storyboard is in the app bundle? Is the storyboard in the app bundle location where the storyboard loading code is expecting it?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to About page
Is this for iOS or Mac? For Mac I can answer. In Xcode choose File > New > File and add a RTF file to your project. Name the file Credits.rtf. Edit the files with what you want to appear in the About box. You can find additional information in the following article: https://www.swiftdevjournal.com/customizing-the-about-box-in-your-mac-app/
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to Do I have to be a paid developer to develop MacOS programs for personal use?
You do not need a paid developer account to develop Mac apps for personal use. You need a paid account to do the following: Submit an app to the Mac App Store Use Apple capabilities like iCloud and Game Center Sign and notarize your app with a developer ID to work with Apple's Gatekeeper feature Gatekeeper makes it painful to open apps that aren't notarized. Without a paid developer account you won't be able to notarize your apps. Your options are to rebuild the apps periodically or bypass Gatekeeper. The following article shows how to bypass Gatekeeper for a single app: https://disable-gatekeeper.github.io
Topic: Code Signing SubTopic: General Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to SwiftUI NSOpenPanel runs but then crashes Mac app
The fileOpenDialog function returns an array of optional URLs. What does that function return when you call it? The following line is going to crash if the array is empty: var csvURLString = fileOpenDialog()[0]?.path SwiftUI has a fileImporter modifier that shows an Open panel so you can avoid using NSOpenPanel. Searching for swiftui fileimporter in a search engine brings up several articles on using the file importer. If you still want to use NSOpenPanel with SwiftUI, the following article may help you: https://serialcoder.dev/text-tutorials/macos-tutorials/save-and-open-panels-in-swiftui-based-macos-apps/
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’22