Can't import CreateMLUI

I have the following code in swift playgrounds in Xcode 10

import CreateMLUI
let builder = MLImageClassifierBuilder()
builder.showInLiveView()


But I get "No such module 'CreateMLUI'"


Anyone knowing if this is my fault, createMLUI not being implemented yet or an error in the installlation of Xcode?

Post not yet marked as solved Up vote post of Harcker2 Down vote post of Harcker2
8.9k views

Replies

Same here

Right now you can try iOS 12 only using the beta version of Xcode, and you will also need macOS Mojave if you want to use the new Create ML tools.


Source https://www.hackingwithswift.com/articles/121/whats-new-in-ios-12

When you creat the playgrond, choose macOS. That worked for me.

didnt work for me, ( I am on Mojave and xcode 10 beta).

For the import this worked, only the MLImageClassifierBuilder isn't available in macOS 10.13.x

Just in case anyone's still wondering, you need:


- A Mac computer on OSX Mojave beta (10.14)

- Xcode 10 beta


Then, the steps are as follow:

- Create a Playground

- By default, it would be set to iOS, so show Inspector (right pane) and change to macOS

- Remove any iOS code (like import UIKit), and write your macOS code (start by import CreateMLUI)

- It's still buggy, so if it doesn't compile, save then Command+Q to quite Xcode

- Relaunch Xcode, compile, hopefully it would work this time.

I originally made the same dumb mistake a lot of other people had and created an iOS playground, but even after creating a Mac OS one I still go the same error. Quitting didn't seem to fix it. What did was:

  1. Create a new single view Mac OS playground
  2. Use a completely different name
  3. Add the import CreateMLUI line
  4. Remove all the other boilerplate


Hope you find a solution...

That works!

Really should bump this up to the top!

CHECKLIST:

1. Select macOS and NOT iOS.

2. Xcode version should be 10+

3. MacOS version should be mojave


STEPS:

1. Create a new playground with macOS application type playground.

2. If creatMLUI is not shown then, close the xcode and restart it.

3. As this is still in beta, it takes few time. Repeat step 2 till compliler identifies "CreateMLUI".

The let builder = MLImageClassifierBuilder() is not working in macOS Sonoma please help