This workshop will be retired on May 31, 2020.
Working with Xcode 83:30 with Pasan Premaratne
If you're using Xcode 8 to take Swift 2 content, you will run into some issues. In this video, let's take a look at why this happens and how you can continue your learning experience without hassles.
- Xcode 7.3.1 - Requires developer account
- Xcode 7 Single View Application Template Starter File
- Xcode 7 Master Detail Application Template Starter
Hi there, I'm for Pason. 0:00 The instructor whose course you'll be taking in just a second. 0:02 Sorry to interrupt you right as you're about to get started but 0:05 I have an important announcement to make. 0:08 If you've already heard me say this feel free to skip. 0:11 The content you're about to take was recorded using Swift 2.0 and Swift 2.3. 0:14 In September 2016, Swift 3 was released. 0:21 And Swift 3 is a big change from Swift 2. 0:25 If you're just getting started, you'll be downloading Xcode, 0:28 the software you'll be using to program from the Mac App Store. 0:32 The latest version of Xcode is 8.0, and it uses Swift 3 by default. 0:36 This is important to know. 0:42 Because when using Xcode 8, the version of Swift you will be writing with and 0:43 the version in the video that you will watch are different. 0:48 And this means that code you see in the video, although correct in Swift 2, 0:52 may not always work on your computer. 0:57 For those of you who've been taking content from before Swift 3 was released, 1:00 this is still important to be aware of. 1:04 Because you may have updated Xcode or depending on how your machine is set up, 1:06 Xcode may have updated automatically. 1:11 Unless you prevented that update, you are also now using Swift 3 by default. 1:14 So what does this mean for you, the student? 1:20 We at Treehouse are working on getting all this with content updated for 1:23 Swift 3 as soon as possible. 1:27 In the meantime, if you want to learn Swift and iOS development immediately, you 1:30 can still continue to take this content but you'll have to work around the issue. 1:34 There are two ways that you can do this. 1:39 The easiest way is to install Xcode 7.3 on your computer. 1:42 You can't do this through the Mac App Store because you'll only get the latest 1:48 version there. 1:52 Instead, you need to go through Apple's Developer Portal. 1:53 In the teachers notes section of this video, 1:57 I've provide a link to download Xcode 7. 2:00 To access this download, you will need a valid Apple Developer account. 2:02 You can have as many versions of Xcode on a single machine as you want. 2:08 So if you already have Xcode 8 installed, you don't have to get rid of it. 2:13 Just make sure that you will always use Xcode 7 for these courses. 2:17 If for some reason you don't want to go this route, there is another way. 2:22 Xcode 8 uses Swift 3 by default, but it can work with Swift 2 as well. 2:26 It can only do this however, 2:32 if you open a file that was created in Xcode 7 and uses Swift 2. 2:35 When you open this file in Xcode 8, 2:40 it will prompt you to convert the project to the latest syntax of Swift. 2:43 You can select not to do this and continue writing in Swift 2. 2:48 In this way, you can take Swift 2 content on Treehouse 2:53 with just a single version of Xcode installed. 2:57 To go this route however, you will need files that were created in Xcode 7. 3:00 I've provided some empty project files below, 3:05 which you can grab through download links. 3:08 And you can use them as your starting point. 3:11 This is pretty cumbersome though. 3:14 So if you do it, 3:16 just remember to always decline to update the project to the latest syntax. 3:17 I hope this helps. 3:23 In the meantime, I'll get working on getting you content in Swift 3. 3:24 Have fun learning. 3:28
You need to sign up for Treehouse in order to download course files.Sign up