Are you sure you created an iOS playground; this is exactly the error you’d get if you created a macOS playground and then tried to import UIKit.
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
I had the same error with xCode 9.3; even creating a iOS Playground.
After some failed tentatives, I closed xCode and reopened it and this time was able to import UIKit.
With your playground window open, open the left-hand and right-hand sidebars from the window's toolbar. On the left, click on the name of your playground. On the right, you should see some options including "Playground Settings" and "Platform". Make sure it's set to "iOS" instead of "macOS"
Thank you. This really helped me.