Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Ilja Daderko
Ilja Daderko
8,953 Points

Good resources that show how to use swift with cocoa and Xcode?

Hello,

I've finished reading swift language documentation today and wanted to try it out and build something simple, but launching Xcode and starting a project I discovered that initial file structure is different, and in general it doesn't feel like many Objective-C practices should be used. Some things like NSString were substituted to String, and I am not sure if there are any more, so I am asking you guys for any good resources that show and explain how to use Swift with Xcode and cocoa maybe?

Sure there is a Treehouse course coming soon on this topic, but I just can't wait to get my hands dirty :D

Stone Preston
Stone Preston
42,016 Points

there is an NDA (non-disclosure agreement) on swift right now, so you may have trouble finding info/tutorials and what not besides apples iBook

1 Answer

P M
P M
7,320 Points

I don't really understand the NDA stuff. The Swift Programming Language is a free book available to everyone, and if you have a developer account, you can already use it. Does it mean that you can't create tutorials based on knowledge you obtained yourself from those sources? Does it mean guys like weheartswift.com are breaking the NDA?

On-topic: http://www.reddit.com/r/swift, www.weheartswift.com should be a decent starting point.

What do you mean by "swift language documentation"? There's a section called "Using Swift with Cocoa and Objective-C" in the docs that answers your question: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/index.html

And if you say you read the Swift documentation and still wondering why NSString is just String in Swift - I suggest you to re-read the documentation and try to understand it more. Swift has modules, which provide namespaces making class prefixing pretty much obsolete. String in Swift has the same functionality as NSString in Objective-C. See "Understanding the Swift Import Process" section at the bottom at the above link to the docs.