# What’s New in Swift 3?

**URL:** <https://forums.kodeco.com/t/what-s-new-in-swift-3/15961>\
**Category:** 🎓 Courses & Articles\
**Created:** [June 15, 2016, 6:37am UTC](https://forums.kodeco.com/t/what-s-new-in-swift-3/15961 "2016-06-15T06:37:04Z")\
**Posts on this page:** 14\
**Page:** 2

<div class="post-metadata">

**Author:** ![benmorrow](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/benmorrow/32/93929_2.png) [@benmorrow](https://forums.kodeco.com/u/benmorrow)\
**Post date:** [July 8, 2016, 4:21am UTC](https://forums.kodeco.com/t/what-s-new-in-swift-3/15961/22 "2016-07-08T04:21:17Z")

</div>

@b0yax Yep, that’s correct. That feature isn’t implemented yet, but they say it will be by the time the final version of Xcode is out.

---

<div class="post-metadata">

**Author:** ![yunpeng](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/yunpeng/32/36759_2.png) [@yunpeng](https://forums.kodeco.com/u/yunpeng)\
**Post date:** [July 12, 2016, 5:48am UTC](https://forums.kodeco.com/t/what-s-new-in-swift-3/15961/23 "2016-07-12T05:48:13Z")

</div>

Swift is no exeption = Swift is no exception:slight\_smile:

---

<div class="post-metadata">

**Author:** ![benmorrow](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/benmorrow/32/93929_2.png) [@benmorrow](https://forums.kodeco.com/u/benmorrow)\
**Post date:** [July 12, 2016, 9:43pm UTC](https://forums.kodeco.com/t/what-s-new-in-swift-3/15961/24 "2016-07-12T21:43:35Z")

</div>

@yunpeng Got that fixed. Thanks!

---

<div class="post-metadata">

**Author:** ![pratima](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/pratima/32/81494_2.png) [@pratima](https://forums.kodeco.com/u/pratima)\
**Post date:** [July 29, 2016, 11:38am UTC](https://forums.kodeco.com/t/what-s-new-in-swift-3/15961/25 "2016-07-29T11:38:10Z")

</div>

Thanks for the nice tutorial. It really helps in understanding the Swift 3 updates.

I tried all the examples in playground of the Xcode 8.0 beta 2. The below example gives me compilation error:

```
for x in sequence(first: 0.1, next: { $0 * 2 }).prefix(while: { $0 < 4 }) { 
   // 0.1, 0.2, 0.4, 0.8, 1.6, 3.2
}

```

1. Firstly, it says “Extraneous argument label ‘while:’ in call”. Xcode provides auto correction to fix this error by removing the “while” parameter name.
2. Then, it says "Cannot convert value of type ‘(int) → Bool’ to excepted argument type ‘int’.

Is this something that has been corrected in the Xcode’s later releases? If so then the tutorial needs to be updated.

Thanks.

---

<div class="post-metadata">

**Author:** ![liamtruong](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/liamtruong/32/37929_2.png) [@liamtruong](https://forums.kodeco.com/u/liamtruong)\
**Post date:** [July 29, 2016, 5:42pm UTC](https://forums.kodeco.com/t/what-s-new-in-swift-3/15961/26 "2016-07-29T17:42:51Z")

</div>

let customStruct = CustomStruct()  
customStruct.Self.staticMethod() // on an instance of the type ==\> the “customStruct.Self” should be “customStruct.self” (small “s”) as it is refering to an instance, right ?

---

<div class="post-metadata">

**Author:** ![benmorrow](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/benmorrow/32/93929_2.png) [@benmorrow](https://forums.kodeco.com/u/benmorrow)\
**Post date:** [August 1, 2016, 10:44pm UTC](https://forums.kodeco.com/t/what-s-new-in-swift-3/15961/27 "2016-08-01T22:44:14Z")

</div>

@liamtruong the capital ‘S’ is correct. Captial ‘s’ `Self` means, “give me the type”. This example uses a type method declared with the `static` keyword. You call type methods on the type itself rather than on an instance of the type. So you can call the method on the type, `CustomStruct.staticMethod()`. Alternatively, you can use `Self` to refer to the type of the instance and call the method on that, `customStruct.Self.staticMethod()`.

---

<div class="post-metadata">

**Author:** ![benmorrow](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/benmorrow/32/93929_2.png) [@benmorrow](https://forums.kodeco.com/u/benmorrow)\
**Post date:** [August 1, 2016, 10:57pm UTC](https://forums.kodeco.com/t/what-s-new-in-swift-3/15961/28 "2016-08-01T22:57:56Z")

</div>

@pratima `prefix(while:)` is part of the [SE-0045](https://github.com/apple/swift-evolution/blob/master/proposals/0045-scan-takewhile-dropwhile.md) proposal. As of Xcode 8 beta 4, that proposal is still awaiting implementation. You can check the status of proposals at the [new hub](https://apple.github.io/swift-evolution/). Hopefully, that proposal receives its implementation in time for the next Xcode beta release.

---

<div class="post-metadata">

**Author:** ![mjcross](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/mjcross/32/38649_2.png) [@mjcross](https://forums.kodeco.com/u/mjcross)\
**Post date:** [August 10, 2016, 1:33pm UTC](https://forums.kodeco.com/t/what-s-new-in-swift-3/15961/29 "2016-08-10T13:33:29Z")

</div>

This was a really useful summary article and I welcome a lot of what’s new in Swift 3. One thing that I wish could be brought more upto date though is the large amount of legacy Apple documentation that assumes a full and intimate familarity with Obj-C. Until this is fixed, it will remain a huge barrier to new entrants to app development being able to learn ‘just’ Swift.

---

<div class="post-metadata">

**Author:** ![mjcross](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/mjcross/32/38649_2.png) [@mjcross](https://forums.kodeco.com/u/mjcross)\
**Post date:** [August 10, 2016, 1:43pm UTC](https://forums.kodeco.com/t/what-s-new-in-swift-3/15961/30 "2016-08-10T13:43:56Z")

</div>

@j-crew perhaps I misunderstood, and I still need to digest all of this - but isn’t the idea that one would write:  
`func someAction.rotate(by angle: CGFloat) { ... }`  
_i.e._ in usage:  
`someAction.rotate(by: someAngle)`  
That idiom seems to make sense because it shows that ‘someAngle’ defines the amount to be rotated by, not the object to be rotated…?

---

<div class="post-metadata">

**Author:** ![benmorrow](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/benmorrow/32/93929_2.png) [@benmorrow](https://forums.kodeco.com/u/benmorrow)\
**Post date:** [August 11, 2016, 7:06pm UTC](https://forums.kodeco.com/t/what-s-new-in-swift-3/15961/31 "2016-08-11T19:06:26Z")

</div>

@mjcross that’s almost correct. That is recommended way to name your functions and methods.

…however, that’s not how the SpriteKit actions are named:

![](https://raywenderlich-com-v3-forums.s3.amazonaws.com/original/3X/1/2/128b5785dc455c240502a2ce24cac242cb0375a8.png)

My guess is that they fall within the rule of, “Compensate for weak type information to clarify a parameter’s role.” Since the CGFloat value of an angle isn’t apparent when you read it at the point of use, they’ve decided to add “Angle” into the parameter name.

---

<div class="post-metadata">

**Author:** ![tosifkanunga](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/tosifkanunga/32/39416_2.png) [@tosifkanunga](https://forums.kodeco.com/u/tosifkanunga)\
**Post date:** [August 22, 2016, 1:02pm UTC](https://forums.kodeco.com/t/what-s-new-in-swift-3/15961/32 "2016-08-22T13:02:47Z")

</div>

ERROR at line 6, col 1: C-style for statement has been removed in Swift 3  
for var x=0; 0\<10; x=1 {  
^

i face this problem please give me solution

---

<div class="post-metadata">

**Author:** ![benmorrow](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/benmorrow/32/93929_2.png) [@benmorrow](https://forums.kodeco.com/u/benmorrow)\
**Post date:** [February 24, 2017, 5:28pm UTC](https://forums.kodeco.com/t/what-s-new-in-swift-3/15961/33 "2017-02-24T17:28:44Z")

</div>

@tosifkanunga, In Swift 3, you need to use a `for-in` statement instead:

```auto
for index in 0..<10 {
  print("\(index) times 5 is \(index * 5)")
}

```

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [November 15, 2017, 9:09pm UTC](https://forums.kodeco.com/t/what-s-new-in-swift-3/15961/34 "2017-11-15T21:09:10Z")

</div>

This tutorial is more than six months old so questions are no longer supported at the moment for it. We will update it as soon as possible. Thank you! :]

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [November 15, 2017, 9:09pm UTC](https://forums.kodeco.com/t/what-s-new-in-swift-3/15961/35 "2017-11-15T21:09:12Z")

</div>

Closed on November 15, 2017, 9:09pm UTC



[Previous page](https://forums.kodeco.com/t/what-s-new-in-swift-3/15961.md?page=1)
