File tree 2 files changed +7
-7
lines changed
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,9 @@ Component
12
12
protocol Shape {
13
13
func draw( fillColor: String )
14
14
}
15
- /*:
15
+ /*:
16
16
Leafs
17
- */
17
+ */
18
18
final class Square : Shape {
19
19
func draw( fillColor: String ) {
20
20
print ( " Drawing a Square with color \( fillColor) " )
@@ -32,11 +32,11 @@ Composite
32
32
*/
33
33
final class Whiteboard : Shape {
34
34
lazy var shapes = [ Shape] ( )
35
-
35
+
36
36
init ( _ shapes: Shape ... ) {
37
37
self . shapes = shapes
38
38
}
39
-
39
+
40
40
func draw( fillColor: String ) {
41
41
for shape in self . shapes {
42
42
shape. draw ( fillColor: fillColor)
@@ -47,4 +47,4 @@ final class Whiteboard : Shape {
47
47
### Usage:
48
48
*/
49
49
var whiteboard = Whiteboard ( Circle ( ) , Square ( ) )
50
- whiteboard. draw ( " Red " )
50
+ whiteboard. draw ( fillColor : " Red " )
Original file line number Diff line number Diff line change 2
2
🍬 Virtual Proxy
3
3
----------------
4
4
5
- The proxy pattern is used to provide a surrogate or placeholder object, which references an underlying object.
5
+ The proxy pattern is used to provide a surrogate or placeholder object, which references an underlying object.
6
6
Virtual proxy is used for loading object on demand.
7
7
8
8
### Example
@@ -13,7 +13,7 @@ protocol HEVSuitMedicalAid {
13
13
14
14
class HEVSuit : HEVSuitMedicalAid {
15
15
func administerMorphine( ) -> String {
16
- return " Morphine aministered . "
16
+ return " Morphine administered . "
17
17
}
18
18
}
19
19
You can’t perform that action at this time.
0 commit comments