Post

Replies

Boosts

Views

Activity

Reply to One Xcode project, different SDKs for different architectures
You don't need to use multiple SDKs. You can use the latest SDK and support older OS versions. If you want to support macOS 10.10, set the deployment target to 10.10. You have to be careful to avoid using anything Apple introduced in later OS versions. For example to using SwiftUI in a Mac app will not allow the app to run on anything earlier than 10.15. Take a look at the following articles for more details: https://www.swiftdevjournal.com/supporting-older-versions-of-ios-and-macos/ https://www.swiftdevjournal.com/using-new-api-features-in-swift-while-supporting-older-os-versions/
Oct ’22
Reply to SpriteKit - How do I learn to use this?
You can find the book 2D Apple Games by Tutorials at the following URL: https://github.com/raywenderlich/deprecated-books SpriteKit hasn't changed much since the book came out. The biggest issue you'll have to deal with is Xcode changes. The following sites has some introductory articles on using SpriteKit: https://www.checksimgames.com/
Topic: App & System Services SubTopic: Core OS Tags:
Oct ’22
Reply to SwiftUI Tutorial Application Alleged Incompatibility with macOS
You don't need to restart the tutorial. The SwiftUI previews are flaky. Try turning off the preview canvas when entering the code for the preview and turning it back on when you're done typing the code. If you don't know how to turn off the preview canvas, read the following: https://swiftdevjournal.github.io/intro-swiftui-guide/Previews If you are still having problems with the canvas, you can turn off the preview canvas and run the project in the Simulator. The Simulator takes a long time to launch the first time you run the project, but after that, building and running the project isn't much slower than the preview canvas.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’22
Reply to SwiftUI Tutorial Application Alleged Incompatibility with macOS
I took a look at the tutorial and I saw nothing in it that requires macOS 13. Can you clarify what you were doing when you got the error messages? Did the errors occur when you were typing code or when you build the project? At that point in the tutorial, it says the previews won't work because of the new stuff you typed. The next section in the tutorial fixes the problem.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’22
Reply to Swiftui MacOS App Example Project OnDelete func
If you are talking about removing items from SwiftUI lists, the modifier for Mac apps is .onDeleteCommand instead of .onDelete, which iOS apps use. For anyone to provide more help, you have to provide the code to delete the item from Core Data and the SwiftUI code for deleting items. The following article may help you: https://www.swiftdevjournal.com/removing-items-from-swiftui-lists-in-mac-apps/
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’22
Reply to Xcode 14 / iOS 16 - UIViewRepresentables must be value types
Were you able to use a class in earlier Xcode versions? I am almost 100 percent sure you have to make PlayerView a struct. SwiftUI views are structs. The UIViewRepresentable protocol lets you wrap UIKit views to use them in SwiftUI apps, essentially converting UIKit views to SwiftUI views. Therefore views that use UIViewRepresentable must be structs. Create a new class that has the @Published property and the Combine publishers. Add an instance of the class to PlayerView. That way you can use the @Published property and have the view be a struct.
Sep ’22
Reply to Using Document Picker to access files inside app directories
A document picker can't access files inside the app bundle. Use the methods in the Bundle class to load files from the app bundle. If you have documents in the app bundle that you want people to open in the app, copy the documents from the app bundle to the app's Documents directory. The FileManager class has a copyItem method to copy a file from one URL to another.
Topic: App & System Services SubTopic: Core OS Tags:
Sep ’22
Reply to Xcode 12.4 builds do not install on devices using iOS 15
What version of iOS is the device running? What version of the iOS 15 support files did you install? Be more specific than iOS 15, such as iOS 15.6. If the device is running a newer version of iOS than the iOS SDK/Support Files, you won't be able to install the app on the device. I have seen multiple questions on these forums about people unable to install apps built with Xcode 13.4.1 on devices running iOS 15.6. Search these forums for those posts, and you might find a workaround. If you're going to use an older Xcode version, turn off automatic updates on your device. Updating iOS requires updating Xcode or installing iOS support files.
Aug ’22
Reply to URL-Session is not working in Command Line App but in Playground
Does the app have the App Sandbox turned on? If so, network connections might be turned off so the networking code won't do anything. There are checkboxes to turn on network connections in the App Sandbox. To check if the app has the App Sandbox turned on, open the project editor by selecting the project from the left side of the project window. Select the app from the target list on the left side of the project editor. Click the App Capabilities button at the top of the project editor.
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’22
Reply to One Xcode project, different SDKs for different architectures
You don't need to use multiple SDKs. You can use the latest SDK and support older OS versions. If you want to support macOS 10.10, set the deployment target to 10.10. You have to be careful to avoid using anything Apple introduced in later OS versions. For example to using SwiftUI in a Mac app will not allow the app to run on anything earlier than 10.15. Take a look at the following articles for more details: https://www.swiftdevjournal.com/supporting-older-versions-of-ios-and-macos/ https://www.swiftdevjournal.com/using-new-api-features-in-swift-while-supporting-older-os-versions/
Replies
Boosts
Views
Activity
Oct ’22
Reply to SpriteKit - How do I learn to use this?
You can find the book 2D Apple Games by Tutorials at the following URL: https://github.com/raywenderlich/deprecated-books SpriteKit hasn't changed much since the book came out. The biggest issue you'll have to deal with is Xcode changes. The following sites has some introductory articles on using SpriteKit: https://www.checksimgames.com/
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to SwiftUI Tutorial Application Alleged Incompatibility with macOS
You don't need to restart the tutorial. The SwiftUI previews are flaky. Try turning off the preview canvas when entering the code for the preview and turning it back on when you're done typing the code. If you don't know how to turn off the preview canvas, read the following: https://swiftdevjournal.github.io/intro-swiftui-guide/Previews If you are still having problems with the canvas, you can turn off the preview canvas and run the project in the Simulator. The Simulator takes a long time to launch the first time you run the project, but after that, building and running the project isn't much slower than the preview canvas.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to SwiftUI Tutorial Application Alleged Incompatibility with macOS
I took a look at the tutorial and I saw nothing in it that requires macOS 13. Can you clarify what you were doing when you got the error messages? Did the errors occur when you were typing code or when you build the project? At that point in the tutorial, it says the previews won't work because of the new stuff you typed. The next section in the tutorial fixes the problem.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Swiftui MacOS App Example Project OnDelete func
If you are talking about removing items from SwiftUI lists, the modifier for Mac apps is .onDeleteCommand instead of .onDelete, which iOS apps use. For anyone to provide more help, you have to provide the code to delete the item from Core Data and the SwiftUI code for deleting items. The following article may help you: https://www.swiftdevjournal.com/removing-items-from-swiftui-lists-in-mac-apps/
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Xcode 14 / iOS 16 - UIViewRepresentables must be value types
Were you able to use a class in earlier Xcode versions? I am almost 100 percent sure you have to make PlayerView a struct. SwiftUI views are structs. The UIViewRepresentable protocol lets you wrap UIKit views to use them in SwiftUI apps, essentially converting UIKit views to SwiftUI views. Therefore views that use UIViewRepresentable must be structs. Create a new class that has the @Published property and the Combine publishers. Add an instance of the class to PlayerView. That way you can use the @Published property and have the view be a struct.
Replies
Boosts
Views
Activity
Sep ’22
Reply to Using Document Picker to access files inside app directories
A document picker can't access files inside the app bundle. Use the methods in the Bundle class to load files from the app bundle. If you have documents in the app bundle that you want people to open in the app, copy the documents from the app bundle to the app's Documents directory. The FileManager class has a copyItem method to copy a file from one URL to another.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to File locations under Xcode 13.4.1 on Monterey 12.5.1
In Xcode choose Product > Show Build Folder in Finder to find your executable in the Finder. Choosing File > Project Settings will open a sheet. The Derived Data location is where Xcode places the executable it builds. If you want the executable in the same folder as your project, choose Project-relative Location from the Derived Data menu.
Replies
Boosts
Views
Activity
Aug ’22
Reply to Xcode 12.4 builds do not install on devices using iOS 15
What version of iOS is the device running? What version of the iOS 15 support files did you install? Be more specific than iOS 15, such as iOS 15.6. If the device is running a newer version of iOS than the iOS SDK/Support Files, you won't be able to install the app on the device. I have seen multiple questions on these forums about people unable to install apps built with Xcode 13.4.1 on devices running iOS 15.6. Search these forums for those posts, and you might find a workaround. If you're going to use an older Xcode version, turn off automatic updates on your device. Updating iOS requires updating Xcode or installing iOS support files.
Replies
Boosts
Views
Activity
Aug ’22
Reply to URL-Session is not working in Command Line App but in Playground
Does the app have the App Sandbox turned on? If so, network connections might be turned off so the networking code won't do anything. There are checkboxes to turn on network connections in the App Sandbox. To check if the app has the App Sandbox turned on, open the project editor by selecting the project from the left side of the project window. Select the app from the target list on the left side of the project editor. Click the App Capabilities button at the top of the project editor.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’22