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/5Version
- Swift 5, iOS 12, Xcode 10
Both value types and reference types can be used together to boost local reasoning without sacrificing performance.
1Values vs References
3:59References give you "spooky-action-at-a-distance" that can be leveraged to solve certain kinds of problems very well.
2inout
3:31In this video, let's take a look at inout: the mechanism which underpins the mutation model in Swift.
3Mutation of self
3:38Find out how self is passed implicitly to models and can be marked inout with mutating in this video.
4Enforce the Law
4:02The Law Exclusivity for memory is another Swift mechanism that improves local reasoning. Learn all about it in this video.
5COW
4:48Copy-on-write is a great way to keep value semantics cheap. Let's take a look at how to implement it.
6Challenge: COW
3:44In this challenge you will try to implement a copy-on-write that reduces reference counting traffic.
7Conclusion
1:25You have seen how values and references work with Swift and how you can use COW to optimize performance and correctness with value type semantics.
8Who 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
Comments