TalkingCode
TalkingCode

Reputation: 13567

Xcode Playground Framework import

While I was working with the Xcode Playground I realized sometimes I have to import Foundation although I already imported Cocoa. Without it functions like sin, cos or lowercaseString refuse to work. As I noticed this morning NSCharacterSet is also not available.

Why it this so? Doesn't the Cocoa Framework already include the Foundation Framework?

At least this is what I learned during Objective-C development.

My Xcode is Version 6.1 (6A1052d)

import Cocoa
import Foundation // Does not work without this line

var resultSin = sin(M_PI)

Upvotes: 0

Views: 471

Answers (1)

Marius Fanu
Marius Fanu

Reputation: 6669

It works just fine, see picture below.enter image description here

enter image description here

Upvotes: 1

Related Questions