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
Another alternate way is to change the template using the Playground Settings. Use the toggle option to show the Utilities.
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.
Your first sentence makes no sense in English.
> No such module Cocoa error message is displayed when you type of the playground file selected is iOS instead of OS X.
When you type of the playground?
Thanks for letting me know. Will correct it.