less than 1 minute read

No such module Cocoa error message is displayed when the type of playground file selected is iOS instead of OS X. Make sure to select Playground under OS X if you want to use Cocoa framework and go for UIKit incase of iOS

Choose a template from your new file

Another alternate way is to change the template using the Playground Settings. Use the toggle option to show the Utilities.

Show the Utilities on Playground

Navigate to Playground Settings section, click the Platform drop down and select OS X from the list. This should also resolve the No such module error on Playground.

Playground Settings

Updated: