No such module Cocoa error message is displayed when you type of the 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 to change the template is to use 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.