24

I am using macOS Mojave Beta (10.14 18A293u) and Xcode 10.0 Beta (10L176w). I created a Swift Playground and I am unable to import CreateMLUI framework in order to use it. I keep getting an import error.

Playground Screenshot

I have tried creating both an iOS Playground and a macOS Playground

Anyone knows what I am doing wrong?

Thanks in advance.

David Cruz
  • 2,995
  • 3
  • 28
  • 41
  • 1
    There are some suggestions in this thread: https://forums.developer.apple.com/message/314438#314438 – koen Jun 06 '18 at 19:55
  • Thanks @Koen found a working solution in that link you provided, will. be posting it as an answer! Thanks again. – David Cruz Jun 06 '18 at 20:00

6 Answers6

48

While macOS Mojave and Xcode 10 are in beta you may experience bugs while trying to use CreateML.

@Koen from one of the comments in my question found a topic in Apple Developer Forums with some workarounds. What I did was:

  1. Create a new single view Mac OS (NOT iOS) playground
  2. Use a completely different name if already created a buggy playground (this is important)
  3. Add the import CreateMLUI line
  4. Remove all the other boilerplate code
grooveplex
  • 2,492
  • 4
  • 28
  • 30
David Cruz
  • 2,995
  • 3
  • 28
  • 41
4

I found the answer to this problem in the apple developers forum (Can't find the exact link to the post). You simply have to select the macOS tab when creating a playground.

infinite369
  • 65
  • 1
  • 11
1

When you create the playground make sure you select "macOS" tab instead of. "iOS".

brockhampton
  • 294
  • 2
  • 8
1

This feature is no longer supported in this environment. You can complete this task in the Create ML app. Follow these steps:

Xcode -> Toolbar -> Open Developer Tool -> Create ML -> New Document

Majid Hajibaba
  • 3,105
  • 6
  • 23
  • 55
0
  1. Open Xcode menu
  2. Choose Open Developer Tool > Create ML
  3. Press New Document
  4. Select Image Classification
  5. Specify name and a place where the project will be saved
IvanPavliuk
  • 1,460
  • 1
  • 21
  • 16
0

In new versions of macOS, the CreateMLUI library has been deprecated and removed. Instead, create models in CreateML, a developer application inside Xcode.

Micheal Bee
  • 550
  • 5
  • 11