Hello everyone,
Is there a way to set the minimum deployment target in Xcode Playground?
Hi, yes, you can modify the Package.swift
file included in your playground. It is normally not accessible within Xcode / Swift Playgrounds but you can edit it if you show the playground's contents in Finder. This file's names comes from Swift packages (Playgrounds are essentially a special type of Swift Package).
Be aware that this file is automatically generated, so there may be chances for it to be overwritten when you change playground's settings, as the warning at the top of it suggests (I would also like more insight into this if somebody else knows - is editing the minimum target version or the target resources a good practice, or is it at risk to be overwritten? From my testings, it seems to work fine with changing the target resources).
Check this thread for ideas on how to support older iOS versions in your code, or modify your Package.swift
file like I explained above.
If this is for the Swift Student Challenge (as your tag suggests), I'm not sure if it's okay to modify the minimum target version. Perhaps the judges will have the latest version of iPadOS / macOS, but currently the website says the following:
"Your app playground must be built with and run on Swift Playgrounds 4.4 or later (requires iPadOS 16 or macOS 13.5) or Xcode 15 on macOS 13.5 or later. You may incorporate the use of Apple Pencil."
https://developer.apple.com/swift-student-challenge/eligibility/