@@ -13,6 +13,14 @@ A short cheat-sheet with Xcode 8.2 Playground ([Design-Patterns.playground.zip](
1313* [ Creational] ( #creational )
1414* [ Structural] ( #structural )
1515
16+
17+ ``` swift
18+
19+ Behavioral |
20+ [Creational](Creational) |
21+ [Structural](Structural)
22+ ```
23+
1624Behavioral
1725==========
1826
@@ -126,6 +134,9 @@ atm.canWithdraw(amount: 30) // Can withdraw - 1x20, 2x10
126134
127135> ** Further Examples:** [ Design Patterns in Swift] ( https://github.com/kingreza/Swift-Chain-Of-Responsibility )
128136
137+ ``` swift
138+
139+ ```
129140
130141👫 Command
131142----------
@@ -291,6 +302,10 @@ var result = expression.evaluate(context)
291302
292303> ** Further Examples:** [ Design Patterns in Swift] ( https://github.com/kingreza/Swift-Interpreter )
293304
305+ ``` swift
306+
307+ ```
308+
294309🍫 Iterator
295310-----------
296311
@@ -403,6 +418,9 @@ spamMonster(message: "I'd Like to Add you to My Professional Network", worker: m
403418
404419> ** Further Examples:** [ Design Patterns in Swift] ( https://github.com/kingreza/Swift-Mediator )
405420
421+ ``` swift
422+
423+ ```
406424
407425💾 Memento
408426----------
@@ -557,6 +575,9 @@ testChambers.testChamberNumber += 1
557575
558576> ** Further Examples:** [ Design Patterns in Swift] ( https://github.com/kingreza/Swift-Observer )
559577
578+ ``` swift
579+
580+ ```
560581
561582🐉 State
562583---------
@@ -625,6 +646,9 @@ userContext.changeStateToUnauthorized()
625646
626647> ** Further Examples:** [ Design Patterns in Swift] ( https://github.com/kingreza/Swift-State )
627648
649+ ``` swift
650+
651+ ```
628652
629653💡 Strategy
630654-----------
@@ -678,6 +702,10 @@ upper.print("O tempora, o mores!")
678702
679703> ** Further Examples:** [ Design Patterns in Swift] ( https://github.com/kingreza/Swift-Strategy )
680704
705+ ``` swift
706+
707+ ```
708+
681709🏃 Visitor
682710----------
683711
@@ -771,6 +799,10 @@ The abstract factory pattern is used to provide a client with a set of related o
771799The "family" of objects created by the factory are determined at run-time.
772800
773801### Example
802+
803+ ``` swift
804+
805+ ```
774806
775807Protocols
776808
@@ -903,6 +935,10 @@ let deathStar = DeathStar(builder:empire)
903935
904936> ** Further Examples:** [ Design Patterns in Swift] ( https://github.com/kingreza/Swift-Builder )
905937
938+ ``` swift
939+
940+ ```
941+
906942🏭 Factory Method
907943-----------------
908944
@@ -1011,6 +1047,10 @@ Eduardo.name = "Eduardo"
10111047
10121048> ** Further Examples:** [ Design Patterns in Swift] ( https://github.com/kingreza/Swift-Prototype )
10131049
1050+ ``` swift
1051+
1052+ ```
1053+
10141054💍 Singleton
10151055------------
10161056
@@ -1118,6 +1158,10 @@ oldFormat.angleV
11181158
11191159> ** Further Examples:** [ Design Patterns in Swift] ( https://github.com/kingreza/Swift-Adapter )
11201160
1161+ ``` swift
1162+
1163+ ```
1164+
11211165🌉 Bridge
11221166----------
11231167
@@ -1488,7 +1532,7 @@ protocol HEVSuitMedicalAid {
14881532
14891533class HEVSuit : HEVSuitMedicalAid {
14901534 func administerMorphine () -> String {
1491- return " Morphine aministered ."
1535+ return " Morphine administered ."
14921536 }
14931537}
14941538
@@ -1514,3 +1558,6 @@ Info
15141558====
15151559
15161560📖 Descriptions from: [ Gang of Four Design Patterns Reference Sheet] ( http://www.blackwasp.co.uk/GangOfFour.aspx )
1561+
1562+
1563+ ``` swift
0 commit comments