Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Loge

macrumors 68030
Original poster
Jun 24, 2004
2,836
1,312
England
While it's great to be able to have multiple pages in an iOS Swift playground, the scope seems to be entirely limited to the current page.

So there's no way to define a class on one page and use it on a subsequent page? Unless I'm missing something very obvious.
 
This is probably because playgrounds is primarily a tool to teach newcomers how to code. It still can serve a purpose of allowing you to write sections of your code, but I don't think it was ever meant to be an exact equivalent to Xcode Playgrounds. Just write out your classes from top to bottom, then when you get back to your Mac, copy each class into it's own file. Beyond this, while the Playgrounds app is cool in it's own rights, it might cause performance issues or even run out of memory if you try to stack a bunch of classes/structs in the same Playground. I haven't done much with the Playgrounds app on iPad, but I do know that Xcode Playgrounds on macOS offers enough flexibility to hang itself on typically much more powerful devices. Probably not a wise decision try and do too much with Playgrounds on iPad.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.