Skip to content

Commit ce15d19

Browse files
author
Bob Lee
committed
Edited Chapter 2 Source Code
1 parent 7bc4c82 commit ce15d19

8 files changed

+8
-8
lines changed

course/object-oriented-swift/computed-property.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ side // 31.6
106106
- Preventing others from manipulating your code
107107

108108
### Source Code
109-
[2002_computed_property.playground](https://www.dropbox.com/sh/sunfww1daece1fe/AAB31bu-Q-_V_ZF2-AOaUdc9a?dl=0)
109+
[2002_computed_property.playground](https://www.dropbox.com/sh/vv5tp1gdb1j2gak/AAD67482Na54FQfKdRJwg9xTa?dl=0)
110110

111111
## Conclusion
112112
You've learned what it means to create a gettable property that can be only read. You've also learned how to create a settable property which allows you to modify its value as well as those of others. The UIKIt framework often utilizes gettable properties to prevent us, developers, from modifying them.

course/object-oriented-swift/convenience-init.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ let myFavoriteColor = UIColor(r: 255, g: 80, b: 85)
5858
2. Custom `convenience` inits with `UIKit`
5959

6060
### Source Code
61-
[2001_convenience_init.playground](https://www.dropbox.com/sh/s8huk2ugoeawb1c/AABvP4MipSe4CSypX7QEgZmZa?dl=0)
61+
[2001_convenience_init.playground](https://www.dropbox.com/sh/gg0vl09ki85j5hz/AAAqLOU8t5tWkIcMCCVJBuAUa?dl=0)
6262

6363
## Conclusion
6464
You've learned how to become lazy and effective at the same time. Imagine, you are the owner of a library for your teammates. They no longer have to use the bloated designated init method. Instead, you may provide multiple `convenience` init methods so that their lives become easier. It is similar to how the Apple engineers have provided us with convenience init methods for `UIColor`. It's a win-win situation.

course/object-oriented-swift/failable-init.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ if let myBlog = blog {
6969
7070

7171
### Source Code
72-
[2004_failable_init.playground](https://www.dropbox.com/sh/zduzf0flqdly0st/AAAkq8tFl8vfQ4FGoRoccLRla?dl=0)
72+
[2004_failable_init.playground](https://www.dropbox.com/sh/na78xmuv8x73du9/AABeGi4-9I36k54_zIum9mb3a?dl=0)
7373

7474
## Conclusion
7575
First, you've learned how design an init method that may return `nil` or an optional object by putting a `?` right to the `init` keyword. As we've discussed many times, anything that has to do with `?` in the Swift Programming Language will give you an optional value. Second, you reviewed the Swift `error handling` approach. Remember, the `throw` keyword is not only used within an `else-if` or `guard` block, but also within an `init` method.

course/object-oriented-swift/override-init-method-property.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ ModelS(enterWheelNumber: 50) // Wow, you've got a nice car
139139
```
140140

141141
### Source Code
142-
[2005_override_init_method_property.playground](https://www.dropbox.com/sh/ij2zoiv26j2oriq/AAB--yW4-5OLaZNSPYjYAROOa?dl=0)
142+
[2005_override_init_method_property.playground](https://www.dropbox.com/sh/an56n4r1ic09dvq/AABTZOHVgf_-rEt7fPoOl72Ba?dl=0)
143143

144144

145145
## Conclusion

course/object-oriented-swift/property-observers.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ userLoginInfo = true
9494
- `willSet` and `didSet` will not get called when you initialize it.
9595

9696
### Source Code
97-
[2003_property_observers.playground](https://www.dropbox.com/sh/tfvmjjrppvy0g01/AABB5kYVgf6ImcptnOvQ53VGa?dl=0)
97+
[2003_property_observers.playground](https://www.dropbox.com/sh/py4uqf01b8m5xcx/AADFHYjIWJEu_LmLGmf7NaoDa?dl=0)
9898

9999
## Conclusion
100100
The purpose of using property observers is not only to write less code but also to provide greater readability through the distinctive keywords. You no longer have to create unnecessary functions filled with `switch` or `else-if` statements. No need.

course/object-oriented-swift/singleton-pattern.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ In each view controller, you have access to only one `AccountManager()`.
4949
The iOS ecosystem often use the singleton pattern for developers to access the universal object. A few examples include, `UIApplication`, `UserDefault`, `NSNotification`. If you wish to learn more about these classes, you may sign up for the upcoming course: [The UIKit Fundamentals with Bob](/ABOUT.md#course).
5050

5151
### Source Code
52-
[2008_singleton_pattern.playground](https://www.dropbox.com/sh/skwlaur16yxwgsf/AADHj1oFxXUovanhnIX6M86Qa?dl=0)
52+
[2008_singleton_pattern.playground](https://www.dropbox.com/sh/dtbnd48v6b4fwah/AAC4JDS6WNe22U4qG3begJioa?dl=0)
5353

5454
### Resources
5555
[The Complete Understanding of Access Control in Swift 3](https://blog.bobthedeveloper.io/the-complete-understanding-of-access-control-in-swift-3-c1c71f2add0b)

course/object-oriented-swift/two-phase-init.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ newRocket.liters // 7.56
4646
newRocket.meters // 91.4
4747
```
4848
### Source Code
49-
[2006_two_phase_init.playground](https://www.dropbox.com/sh/e8bnkpbuurly7cu/AAAaACwZ5M0i_vP6Df7Twxqja?dl=0)
49+
[2006_two_phase_init.playground](https://www.dropbox.com/sh/f028fdc3n7vy10n/AADP3OItB2SValnXXFjCo13ka?dl=0)
5050

5151

5252
## Conclusion

course/object-oriented-swift/type-property-method.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ AirDropID.iPhone8.rawValue // "7967-8123-7892-4563"
115115
```
116116

117117
### Source Code
118-
[2007_type_property.playground](https://www.dropbox.com/sh/vkvljugb258t153/AAB2WsksH_AkczcD8kdt5x3ha?dl=0)
118+
[2007_type_property.playground](https://www.dropbox.com/sh/y4cqhy4v912e01a/AABxIMrWsWch3h3C693Q2gWAa?dl=0)
119119

120120

121121
## Conclusion

0 commit comments

Comments
 (0)