3 ms·
> The Swift Playgrounds app really hasn’t gotten any love[1] since it was first introduced. The UI has been changed slightly. > You can actually import UIKit
by saagarjha 8y ago
> The Swift Playgrounds app really hasn’t gotten any love[1] since it was first introduced.
The UI has been changed slightly.
> You can actually import UIKit and the other frameworks and compile them on the iPad but this is pretty much undocumentated.
Well, it's UIKit. You can just pull up the documentation at developer.apple.com.
> The preview views are tremendously buggy (really the whole app is) and there is all sorts of hidden debug stuff running in the background[2] that slows down performance.
The app is very buggy, but the debug stuff cannot be turned off because it's compiled into the code you write.
> Everything has to be in a single file so doing anything moderately complicated is a pain
No: you can add additional files to the "Sources" folder. This is how Apple's tutorial playgrounds work.
- Pulcinella 8y agoWhen I say it’s in undocumented I mean that the fact that you can use UIkit at all is undocumented. You can use it but you are never told you can. Also there is little documentation that explains things like XCPlayground and PlaygroundsSupport. You kind of have to adapt them from the Xcode Playgrounds for the Mac but the fact that you can do this is never mentioned. Also the limitations on Swift Playgrounds are never mentioned anywhere (e.g. autolayout constraints don’t really work for the Playgrounds previews. Also, my complaint was that you cannot turn of the debug stuff. You actually can if you turn off things like logging in a template file on the Mac and then move that to the ipad. At that point you might as well just use the Mac though. See here for what I’m talking about. http://saltpigmedia.com/blog/Modules-in-Swift-Playgrounds http://saltpigmedia.com/blog/Modules-in-Swift-Playgrounds Also, as far as I am aware, you cannot add to the sources folder on the iPad itself. That requires a Mac. My comments were in regard to using Swift Playgrounds as a pseudo-Xcode. It does indeed compile swift code and UIKit, so a lot of that groundwork is there. And I would love to use the iPad to do real coding, and Swift Playgrounds is real tempting, but it just doesn’t work and I find that disappointing.
- saagarjha 8y ago> When I say it’s in undocumented I mean that the fact that you can use UIkit at all is undocumented. A couple of the example playgrounds expose this. > Also there is little documentation that explains things like XCPlayground and PlaygroundsSupport. Documentation is available here: https://developer.apple.com/documentation/playgroundsupport https://developer.apple.com/documentation/playgroundsupport. It's not great, but it's getting better. > Also the limitations on Swift Playgrounds are never mentioned anywhere (e.g. autolayout constraints don’t really work for the Playgrounds previews. They do, but in a buggy way. I have long considered this to be a defect and have filed Radars about this. > Also, as far as I am aware, you cannot add to the sources folder on the iPad itself. That requires a Mac. You can create playgrounds on the fly with the Files app, if you know the structure they must have. You cannot edit them in Swift Playgrounds.