Home > other >  No such module 'SPCCore' in Playground. Where is an equivalent module?
No such module 'SPCCore' in Playground. Where is an equivalent module?

Time:09-28

Swift Playgrounds' book Shapes uses three modules:

import PlaygroundSupport import SPCCore import UIKit

I can use PlaygroundSupport and UIKit in my own Playground. However, I cannot use SPCCore: No such module 'SPCCore'

I've looked for an equivalent in the Swift documents. Trial and error is a slow process.

Do you have any recommended module I can use to display scenes?

Thank you!

CodePudding user response:

If you locate the Shapes playground in the Finder (by bringing up the contextual menu on it and choosing "Show in Finder") you can look inside it (by control clicking on the file and choosing "Show Package Contents").

Inside that folder you will see a folder called "Modules" and SPCCore.playgroundmodule is found in there.

That means that SPCCore is a module that is specific to this Playground and that the original author didn't intend you to use it in other Playgrounds.

Now, having said that, you are free to poke around in the project yourself and see what you can learn - but you should be careful not to publish any Playgrounds that contain that module unless you are within the bounds of the "License.txt" file contained within the playground.

Ideally what I would recommend is starting any project you want by copying the Shapes playground, deleting other code, and adding in your own code.

Package contents of the Shapes Playground

  • Related