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 trial2 Answers
Michael Hulet
47,913 PointsSince Swift 4 was only just released, the current Swift courses are all in Swift 3. However, Swift 3 is still perfectly valid syntax in most cases, but it'll be 100% valid all the time if you set the compiler for your project to run in Swift 3.2 mode. That being said, there's currently a What's New in Swift 4 workshop where you can get a feel for the differences and start to use them in practice
Zachary Browne
iOS Development with Swift Techdegree Student 195 PointsHave the videos in IOS Development Techdegree been updated to Swift 4? It has been out for a while now.
Michael Hulet
47,913 PointsThis question is likely best for one of the staff members in the iOS Techdegree Slack workspace. That being said, I recently joined the iOS Techdegree, and I'm near submitting project 1. It didn't look like the videos in unit 1 have been re-recorded in about 2 years, but there also didn't seem to be any difference between the code in the videos and what you'd write in Swift 4. Swift 4 doesn't have very many breaking changes from Swift 3, so it's just fine imo to learn from Swift 3 videos and read a Swift 3 -> Swift 4 changelog (or take the overview workshop I linked in my answer). It seems to me that the current iOS videos are still valid in the vast majority of all cases
David Nissolle
2,168 PointsDavid Nissolle
2,168 PointsHi Michael! How would I go about setting the compiler to run in Swift 3.2 mode?
Michael Hulet
47,913 PointsMichael Hulet
47,913 PointsClick on your project in Xcode's sidebar so it brings up the information about it (display name, team info, build target, frameworks you've linked, etc)
Next, click on the tab along the top for "Build Settings" to bring up the build settings view
Do a quick search in the search bar on that page for "
Swift
". To run the compiler in Swift 3.2 mode, change the setting next to "Swift Language Version
" to "3.2
". To mimic true Swift 3 behavior, you'll also have to set "Swift 3 @objc Inference
" to "On
", but I recommend you leave it "Off
", as it results in smaller app sizes. If you're having trouble with your app, you can turn it back on, or you can mark all the methods/properties that you want UIKit/Foundation/whatever Objective-C framework you're using (target/action selectors, delegate methods, anything that an Objective-C framework has to know about) as@objc
before itsfunc
orvar
keyword.You'll have to repeat that for every entry in the sidebar with the titles "Project" and "Targets", here:
After that, Swift will behave like it does in all of the current videos on Treehouse
Nathaniel Idahosa
2,795 PointsNathaniel Idahosa
2,795 PointsSince Swift 4 has been around for a while now, has the version for the iOS Development Techdegree been Updated to version 4?