Christian Dechery
Christian Dechery

Reputation: 880

Code will build on Xcode but no run on Playground. Why?

So, I'm a beginner with Swift and please forgive me if this is some stupid thing I'm missing.

I'm trying to test some JSON requests and I got the SwiftyJSON lib. It will build within Xcode, but I would like to use Playground so I'd be able to easily run some tests with it. Thing is, I pasted the entire code of the lib on Playground and and it doesn't work. There are all sorts of compilation errors on Playground that didn't show on Xcode.

What is different? What are the limitations within Playground that could be causing this?

Upvotes: 0

Views: 211

Answers (1)

Ajinkya Patil
Ajinkya Patil

Reputation: 5548

Drop the SwiftyJSON.swift file in Sources folder in your playground & build .Thats it you can use SwifyJSONenter image description here

Upvotes: 1

Related Questions