import UIKit error

When I try to import the UIKit into Xcode Playgrounds, the error 'No such module' appears. Does anyone know how to fix this?

Post not yet marked as solved Up vote post of mbueno Down vote post of mbueno
11k views

Replies

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.

Add a Comment

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.

Post not yet marked as solved Up vote reply of Ibin Down vote reply of Ibin