Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Beginning Swift
  • Toc
  • feedback
Beginning Swift

Beginning Swift

By : Rob Kerr, Kåre Morstøl
4 (1)
close
Beginning Swift

Beginning Swift

4 (1)
By: Rob Kerr, Kåre Morstøl

Overview of this book

Take your first foray into programming for Apple devices with Swift.Swift is fundamentally different from Objective-C, as it is a protocol-oriented language. While you can still write normal object-oriented code in Swift, it requires a new way of thinking to take advantage of its powerful features and a solid understanding of the basics to become productive.
Table of Contents (10 chapters)
close

Chapter 4. Collections

In the previous lesson, we looked into building Swift functions, error handling, and developing fully-featured Swift programs. We also briefly looked at a few OOP features.

In this lesson, we will work extensively with Swift's collections, such as arrays, sets, and dictionaries.

The Swift Standard Library ( https://developer.apple.com/documentation/swift) is automatically imported into all Swift code, and contains basic types such as Int, Double, Bool, Optional, and more. It is primarily organized around protocols, because Swift is a Protocol-Oriented language ( https://developer.apple.com/videos/play/wwdc2015/408/).

The root protocol for collections, which they all inherit from, is Sequence. All a type needs to conform to it is the ability to provide one value at a time, until it is empty, at which point it will output nil. This simple requirement provides a long list of methods ( https://developer.apple.com/documentation...

bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete