Advanced Swift: Values and References

Apr 23 2019 · Video Course (27 mins) · Advanced

Swift mutation model uses values and references to improve local reasoning and maintain performance. Find out the details in this course.

5/5 2 Ratings · Leave a Rating

Version

  • Swift 5, iOS 12, Xcode 10

Introduction

1:33 Free

Both value types and reference types can be used together to boost local reasoning without sacrificing performance.

1

References give you "spooky-action-at-a-distance" that can be leveraged to solve certain kinds of problems very well.

2

inout

3:31

In this video, let's take a look at inout: the mechanism which underpins the mutation model in Swift.

3

Find out how self is passed implicitly to models and can be marked inout with mutating in this video.

4

The Law Exclusivity for memory is another Swift mechanism that improves local reasoning. Learn all about it in this video.

5

COW

4:48

Copy-on-write is a great way to keep value semantics cheap. Let's take a look at how to implement it.

6

In this challenge you will try to implement a copy-on-write that reduces reference counting traffic.

7

Conclusion

1:25

You have seen how values and references work with Swift and how you can use COW to optimize performance and correctness with value type semantics.

8

Who is this for?

This course is for developers interested in getting a deeper understanding of the Swift language. It expects you to be comfortable with the basic syntax of Swift and to have perhaps written an app or two. You should be familiar with basic types in the Swift standard library.

Covered concepts

This course focuses on:

  • Values
  • References
  • Copy on write
  • Exclusivity
  • inout
  • self

Contributors

Comments