Skip to content

Commit 1bf272d

Browse files
Tavernariochococo
authored andcommitted
Fix texts and index
1 parent 7f4d75d commit 1bf272d

File tree

5 files changed

+11
-17
lines changed

5 files changed

+11
-17
lines changed
-1 Bytes
Binary file not shown.

β€ŽDesign-Patterns.playground/Pages/Creational.xcplaygroundpage/Contents.swiftβ€Ž

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,7 @@ CurrencyFactory.currency(for: .uk)?.code ?? noCurrencyCode
196196
πŸ”‚ Monostate
197197
------------
198198

199-
The monostate pattern is a alternativa to singleton, so in that case monostate still
200-
the state as static instead of all object as singleton. You can use a protocol to apply
201-
dependency inversion helping you on unit tests.
199+
The monostate pattern is an alternative to singleton, so in that case, monostate saves the state as static instead of the entire instance as a singleton. You can use a protocol to apply dependency inversion helping you on unit tests.
202200

203201
### Example:
204202
*/
@@ -224,10 +222,10 @@ struct Settings {
224222
let settings = Settings() // Starts using theme .old
225223
settings.theme = .new // Change theme to .new
226224

227-
//On Screen 1
225+
//On screen 1
228226
let screenColor: Color = Settings().theme == .old ? .gray : .white
229227

230-
//On Screen 2
228+
//On screen 2
231229
let screenTitle: String = Settings().theme == .old ? "Itunes Connect" : "App Store Connect"
232230
/*:
233231
πŸƒ Prototype

β€ŽREADME.mdβ€Ž

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ print("Welcome!")
2727
| [πŸ‘« Command](#-command) | [πŸ‘· Builder](#-builder) | [πŸŒ‰ Bridge](#-bridge) |
2828
| [🎢 Interpreter](#-interpreter) | [🏭 Factory Method](#-factory-method) | [🌿 Composite](#-composite) |
2929
| [🍫 Iterator](#-iterator) | [πŸƒ Prototype](#-prototype) | [🍧 Decorator](#-decorator) |
30-
| [πŸ’ Mediator](#-mediator) | [πŸ’ Singleton](#-singleton) | [🎁 FaΓ§ade](#-fa-ade) |
30+
| [πŸ’ Mediator](#-mediator) | [πŸ’ Singleton](#-singleton) || [πŸ”‚ Monostate](#-monostate) | [🎁 FaΓ§ade](#-fa-ade) |
3131
| [πŸ’Ύ Memento](#-memento) | | [πŸƒ Flyweight](#-flyweight) |
3232
| [πŸ‘“ Observer](#-observer) | | [β˜” Protection Proxy](#-protection-proxy) |
3333
| [πŸ‰ State](#-state) | | [🍬 Virtual Proxy](#-virtual-proxy) |
@@ -1007,9 +1007,7 @@ CurrencyFactory.currency(for: .uk)?.code ?? noCurrencyCode
10071007
πŸ”‚ Monostate
10081008
------------
10091009

1010-
The monostate pattern is a alternativa to singleton, so in that case monostate still
1011-
the state as static instead of all object as singleton. You can use a protocol to apply
1012-
dependency inversion helping you on unit tests.
1010+
The monostate pattern is an alternative to singleton, so in that case, monostate saves the state as static instead of the entire instance as a singleton. You can use a protocol to apply dependency inversion helping you on unit tests.
10131011

10141012
### Example:
10151013

@@ -1038,10 +1036,10 @@ struct Settings {
10381036
let settings = Settings() // Starts using theme .old
10391037
settings.theme = .new // Change theme to .new
10401038

1041-
//On Screen 1
1039+
//On screen 1
10421040
let screenColor: Color = Settings().theme == .old ? .gray : .white
10431041

1044-
//On Screen 2
1042+
//On screen 2
10451043
let screenTitle: String = Settings().theme == .old ? "Itunes Connect" : "App Store Connect"
10461044
```
10471045

β€Žsource/contentsReadme.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
| [πŸ‘« Command](#-command) | [πŸ‘· Builder](#-builder) | [πŸŒ‰ Bridge](#-bridge) |
88
| [🎢 Interpreter](#-interpreter) | [🏭 Factory Method](#-factory-method) | [🌿 Composite](#-composite) |
99
| [🍫 Iterator](#-iterator) | [πŸƒ Prototype](#-prototype) | [🍧 Decorator](#-decorator) |
10-
| [πŸ’ Mediator](#-mediator) | [πŸ’ Singleton](#-singleton) | [🎁 FaΓ§ade](#-fa-ade) |
10+
| [πŸ’ Mediator](#-mediator) | [πŸ’ Singleton](#-singleton) || [πŸ”‚ Monostate](#-monostate) | [🎁 FaΓ§ade](#-fa-ade) |
1111
| [πŸ’Ύ Memento](#-memento) | | [πŸƒ Flyweight](#-flyweight) |
1212
| [πŸ‘“ Observer](#-observer) | | [β˜” Protection Proxy](#-protection-proxy) |
1313
| [πŸ‰ State](#-state) | | [🍬 Virtual Proxy](#-virtual-proxy) |

β€Žsource/creational/monostate.swiftβ€Ž

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
πŸ”‚ Monostate
33
------------
44

5-
The monostate pattern is a alternativa to singleton, so in that case monostate still
6-
the state as static instead of all object as singleton. You can use a protocol to apply
7-
dependency inversion helping you on unit tests.
5+
The monostate pattern is an alternative to singleton, so in that case, monostate saves the state as static instead of the entire instance as a singleton. You can use a protocol to apply dependency inversion helping you on unit tests.
86

97
### Example:
108
*/
@@ -30,8 +28,8 @@ struct Settings {
3028
let settings = Settings() // Starts using theme .old
3129
settings.theme = .new // Change theme to .new
3230

33-
//On Screen 1
31+
//On screen 1
3432
let screenColor: Color = Settings().theme == .old ? .gray : .white
3533

36-
//On Screen 2
34+
//On screen 2
3735
let screenTitle: String = Settings().theme == .old ? "Itunes Connect" : "App Store Connect"

0 commit comments

Comments
Β (0)