'init' has been renamed to 'init(describing:)' in XCode8

2k Views Asked by At

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...)

2

There are 2 best solutions below

0
On BEST ANSWER

Add import Foundation to the top of your playground.

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

0
On

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