Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.