Hello! I have a quick question about locking orientation and disabling Multitasking/Slide Over in a .swiftpm for the Swift Student Challenge.
A .swiftpm file contains a Package.swift file. At the top of this file, there is a very scary warning that directs you to not edit it. However, being unable to edit this means that I cannot lock the orientation of an iPad and disable Multitasking/Slide Over.
I have read that it does not break your project if you ignore the warning and I tried it out for myself — editing the file does indeed lock orientation and disable Multitasking/Slide Over! Although, as you can imagine, this is quite nerve-wracking.
What are the actual technical implications of doing this? Are participants allowed to do this?
If this does not seem like a good idea, would judges follow through with a note that tells them to simply not use certain orientations and Multitasking/Slide Over? (Yeah, I know… not an ideal thing but if there’s anyone to understand it would be Apple employees).
I am faced with two uncertain options: ignore a warning and get what I need or follow the warning but then have a very poorly designed experience (some apps just aren’t meant for portrait and Multitasking/Slide Over, even if this is not a full app).
I definitely don’t want hundreds of hours of work to go down the drain or risk rejection because of some type of problem with this, that’s for sure. Perhaps a “hack” would work if I were creating an actual app, but the stakes become higher when it is for this challenge.
Thanks! :)
Hi there! We do not recommend editing Package.swift directly because Swift Playgrounds can, at any point, replace the entire contents of the file. That being said, we do make every effort to preserve the content of the file as long as Swift Playgrounds understands the changes that were made.
Typically, Swift Playgrounds will not write out a new copy of Package.swift unless changes are made in the App Settings panel for your app. You may want to test making a change there (for instance, temporarily change your app's name) to see if your orientation setting is preserved. If it is, it is probably totally safe to do so.
Also, you should feel free to leave a note to the challenge judges about what orientations you have tested your app with. Be aware that your app playground may be judged within the context of the Swift Playgrounds app itself unless explicitly noted otherwise, which means by default it will be rendered at the default preview canvas size in landscape orientation.