-1

It's really going crazy, this single simple line doesn't compile, why? enter image description here

I'm using Xcode Version 8.1 (8B62) Here's the api reference for String(format: String, _ arguments: CVarArg...)

Nandin Borjigin
  • 2,094
  • 1
  • 16
  • 37

2 Answers2

3

Add import Foundation to the top of your playground.

This will import the Foundation Framework and will allow you to use its API.

ChaosCoder
  • 3,085
  • 1
  • 22
  • 23
-1

It's really embarrassing to find that String(format: String, _ arguments: CVarArg...) is part of Foundation and not an default constructor....

The solution is that put import Foundation on the top of the playground

Nandin Borjigin
  • 2,094
  • 1
  • 16
  • 37