Post

Replies

Boosts

Views

Activity

Swift playground File under Source not complete
Hello,I created a playground, in this playground, I created a class, I instantiate it, everything is fine. I create the same class in a source swift file, make my class public but ... I do not have the foundation framework methods! for example, no ... uppercased! While I have these methods in the basic playground (I also use the framework foundation). What am I doing wrong? thanks a lot for your help// Works with the Playground import Foundation import PlaygroundSupport class me { var firstName: String var lastName: String init(firstName: String, lastName: String) { self.firstName = firstName self.lastName = lastName } func mergeUpperCase() -> String { return firstName.uppercased() + " " + lastName.uppercased() } } // Don't work with the Swift File under Sources import Foundation public class Person { public var firstName: String public var lastName: String public init(firName: String, lastName: String) { self.firstName = firName self.lastName = lastName } public func merge() -> String { return firstName + " " + lastName } public func mergeUpperCase() -> String { return firstName.xxxx + " " + lastName.xxxx // xxxx = no method uppercased() } }
7
0
5.4k
Jan ’18