Changes in Xcode 6 Beta 4

Xcode 6 Beta 4 brought some important changes related to constantly evolving Swift Language. Below is a compilation of the most important ones.

TOC

Access Control

.by() -> stride()

Unicode String improvements

Revised Declaration Modifiers

Landmarks


Access Control

Access levels

Entities can be:

Things to remember

Limitations


.by() -> stride()

The .by() method for ranges has been replaced with general stride() functions.

Usage

Examples

stride(from: x, to: y, by: z)           //was: (x..<y).by(z)
stride(from: x, through: y, by: z)      //was: (x...y).by(z)

Unicode String improvements

The String type now implements a grapheme cluster segmentation algorithm to produce Characters. This means that iteration over complex strings that include combining marks, variation sequences, and regional indicators work properly.

// returns 15
countElements("a\u{1F30D}cafe\u{0301}umbrella\u{FE0E} \u{1F1E9}\u{1F1EA}”)

A for-in loop over the string produces each human visible character in sequence.


Revised Declaration Modifiers

The @final, @lazy, @optional, and @required attributes have been converted to declaration modifiers, specified without an @ sign.


Landmarks

Finally! Xcode now supports //MARK:, //TODO: and //FIXME landmarks to annotate your code and lists them in the jump bar.


Let me know if you think I missed something important and feel free to comment below!

comments powered by Disqus