File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,9 @@ Component
1212protocol Shape {
1313 func draw( fillColor: String )
1414}
15- /*:
15+ /*:
1616Leafs
17- */
17+ */
1818final class Square : Shape {
1919 func draw( fillColor: String ) {
2020 print ( " Drawing a Square with color \( fillColor) " )
@@ -32,11 +32,11 @@ Composite
3232*/
3333final class Whiteboard : Shape {
3434 lazy var shapes = [ Shape] ( )
35-
35+
3636 init ( _ shapes: Shape ... ) {
3737 self . shapes = shapes
3838 }
39-
39+
4040 func draw( fillColor: String ) {
4141 for shape in self . shapes {
4242 shape. draw ( fillColor: fillColor)
@@ -47,4 +47,4 @@ final class Whiteboard : Shape {
4747### Usage:
4848*/
4949var whiteboard = Whiteboard ( Circle ( ) , Square ( ) )
50- whiteboard. draw ( " Red " )
50+ whiteboard. draw ( fillColor : " Red " )
Original file line number Diff line number Diff line change 22🍬 Virtual Proxy
33----------------
44
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.
66Virtual proxy is used for loading object on demand.
77
88### Example
@@ -13,7 +13,7 @@ protocol HEVSuitMedicalAid {
1313
1414class HEVSuit : HEVSuitMedicalAid {
1515 func administerMorphine( ) -> String {
16- return " Morphine aministered . "
16+ return " Morphine administered . "
1717 }
1818}
1919
You can’t perform that action at this time.
0 commit comments