0

The documentation mentions:

add pages to your playground to help organize your code.

But I’m unable to access a class from a different Page. I tried setting everything public, and even creating the class in the Sources folder by starting the playground in Xcode but it crashes on launch with Problem Running Playground

I would really appreciate some help. I’m trying to use Playgrounds more, but don’t want to have all my classes & extensions in one Page.

pesch
  • 1,976
  • 2
  • 17
  • 29
  • 1
    Your approach is correct! Try to put classes in separate files in side the Sources folder. The "Problem Running Playground" error is kinda hard to debug. Try to add log statements to your playground and see where the problem occurs. See here for how to add debug statements: https://stackoverflow.com/questions/55397751/how-can-i-print-to-console-in-swift-playgrounds-on-ipad – jraufeisen Apr 09 '19 at 08:57
  • Thanks @JoRa, but is it possible to add files to Sources from iPad? If so, I cannot find how – pesch Apr 09 '19 at 14:17
  • You need access to the underlying folder-structure of a playground. I do not know any way to achieve this on iPad. You can download your playground from iCloud and open it on a desktop computer. – jraufeisen Apr 11 '19 at 16:07

0 Answers0