Clicky

iOS Dev Nugget 141 Great Swift Standard Library Examples Covered in Playground (Swift 2.0)

.

Need to run a code review on your codebase? Hire me

The WWDC 2015 sample code includes very good examples of Swift standard library usage in the Swift Standard Library sample. For example, there's code like how to retrieve substrings correctly:

var str = "Héllo, 🇺🇸laygr😮und!"

let range = advance(str.startIndex, 4)...advance(str.startIndex, 12)
str[range.startIndex]
str[range]
str[advance(str.startIndex, 7)]

You can find all the samples here.


Your feedback is valuable: Do you want more nuggets like this?   Yes   or   No

.

.

Like this and want such iOS dev nuggets to be emailed to you, weekly?

Sign Me Up! or follow @iosdevnuggets on Twitter

.

View archives of past issues