I should have written it clearly, but `recently` meant Swift 1.2 (comes with Xcode 6.3) and after.Till Swift 1.1, I used something like this:class UserInfo { class var sharedInfo: UserInfo { struct My { static var instance = UserInfo() } return My.instance } var userFirstName: String? var userLastName: String? }(Sorry, I removed all Xcode 6.1.x installations, and I cannot check if the above code actually works in Xcode 6.1.1 .)If you don't have some specific reasons, you'd better upgrade your Xcode.
Topic:
Programming Languages
SubTopic:
Swift
Tags: