Skip to content

Commit 01f5c85

Browse files
committed
Cleanup + formatting
1 parent a8bafa2 commit 01f5c85

25 files changed

+86
-90
lines changed

Design-Patterns.playground.zip

168 Bytes
Binary file not shown.

Design-Patterns.playground/Documentation/section-1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ <h1 id="creational">Creational</h1>
2121
<p>In software engineering, creational design patterns are design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation. The basic form of object creation could result in design problems or added complexity to the design. Creational design patterns solve this problem by somehow controlling this object creation.</p>
2222
<p><strong>Source:</strong> <a href="http://en.wikipedia.org/wiki/Creational_pattern">wikipedia.org</a></p>
2323
</blockquote>
24-
<h2 id="singleton">Singleton</h2>
24+
<h2 id="-singleton">💍 Singleton</h2>
2525

2626
</section>
2727
</div>

Design-Patterns.playground/Documentation/section-11.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<body>
1212
<div class="content-wrapper">
1313
<section class="section">
14-
<h2 id="abstract-factory">Abstract Factory</h2>
14+
<h2 id="-abstract-factory">🌰 Abstract Factory</h2>
1515

1616
</section>
1717
</div>

Design-Patterns.playground/Documentation/section-15.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<body>
1212
<div class="content-wrapper">
1313
<section class="section">
14-
<h2 id="prototype">Prototype</h2>
14+
<h2 id="-prototype">🃏 Prototype</h2>
1515

1616
</section>
1717
</div>

Design-Patterns.playground/Documentation/section-19.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<body>
1212
<div class="content-wrapper">
1313
<section class="section">
14-
<h2 id="factory-method">Factory Method</h2>
14+
<h2 id="-factory-method">🏭 Factory Method</h2>
1515

1616
</section>
1717
</div>

Design-Patterns.playground/Documentation/section-23.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ <h1 id="structural">Structural</h1>
1616
<p>In software engineering, structural design patterns are design patterns that ease the design by identifying a simple way to realize relationships between entities.</p>
1717
<p><strong>Source:</strong> <a href="http://en.wikipedia.org/wiki/Structural_pattern">wikipedia.org</a></p>
1818
</blockquote>
19-
<h2 id="composite">Composite</h2>
19+
<h2 id="-composite">🌿 Composite</h2>
2020

2121
</section>
2222
</div>

Design-Patterns.playground/Documentation/section-27.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<body>
1212
<div class="content-wrapper">
1313
<section class="section">
14-
<h2 id="fa-ade">Façade</h2>
14+
<h2 id="-fa-ade">🎁 Façade</h2>
1515

1616
</section>
1717
</div>

Design-Patterns.playground/Documentation/section-31.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<body>
1212
<div class="content-wrapper">
1313
<section class="section">
14-
<h2 id="adapter">Adapter</h2>
14+
<h2 id="-adapter">🔌 Adapter</h2>
1515

1616
</section>
1717
</div>

Design-Patterns.playground/Documentation/section-35.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
<body>
1212
<div class="content-wrapper">
1313
<section class="section">
14-
<h2 id="bridge">Bridge</h2>
15-
<h2 id="decorator">Decorator</h2>
16-
<h2 id="proxy">Proxy</h2>
14+
<h2 id="-bridge">🚧 Bridge</h2>
15+
<h2 id="-decorator">🚧 Decorator</h2>
16+
<h2 id="-proxy">🚧 Proxy</h2>
1717
<h1 id="behavioral">Behavioral</h1>
1818
<blockquote>
1919
<p>In software engineering, behavioral design patterns are design patterns that identify common communication patterns between objects and realize these patterns. By doing so, these patterns increase flexibility in carrying out this communication.</p>
2020
<p><strong>Source:</strong> <a href="http://en.wikipedia.org/wiki/Behavioral_pattern">wikipedia.org</a></p>
2121
</blockquote>
22-
<h2 id="chain-of-responsibility">Chain Of Responsibility</h2>
23-
<h2 id="command">Command</h2>
22+
<h2 id="-chain-of-responsibility">🚧 Chain Of Responsibility</h2>
23+
<h2 id="-command">👫 Command</h2>
2424

2525
</section>
2626
</div>

Design-Patterns.playground/Documentation/section-39.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
<body>
1212
<div class="content-wrapper">
1313
<section class="section">
14-
<h2 id="iterator">Iterator</h2>
15-
<h2 id="mediator">Mediator</h2>
16-
<h2 id="memento">Memento</h2>
17-
<h2 id="observer">Observer</h2>
18-
<h2 id="state">State</h2>
14+
<h2 id="-iterator">🚧 Iterator</h2>
15+
<h2 id="-mediator">🚧 Mediator</h2>
16+
<h2 id="-memento">🚧 Memento</h2>
17+
<h2 id="-observer">🚧 Observer</h2>
18+
<h2 id="-state">🐉 State</h2>
1919

2020
</section>
2121
</div>

Design-Patterns.playground/Documentation/section-43.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<body>
1212
<div class="content-wrapper">
1313
<section class="section">
14-
<h2 id="strategy">Strategy</h2>
14+
<h2 id="-strategy">💡 Strategy</h2>
1515

1616
</section>
1717
</div>

Design-Patterns.playground/Documentation/section-47.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<body>
1212
<div class="content-wrapper">
1313
<section class="section">
14-
<h2 id="visitor">Visitor</h2>
14+
<h2 id="-visitor">🏃 Visitor</h2>
1515

1616
</section>
1717
</div>

Design-Patterns.playground/Documentation/section-5.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<body>
1212
<div class="content-wrapper">
1313
<section class="section">
14-
<h2 id="builder">Builder</h2>
14+
<h2 id="-builder">👷 Builder</h2>
1515

1616
</section>
1717
</div>

Design-Patterns.playground/section-10.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
let uglierPoint = Point{
1+
let uglierPoint = Point {
22
$0.x = 0.1
33
$0.y = 0.2
44
$0.z = 0.3
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1-
class Number
2-
{
3-
var number:AnyObject
1+
class Number {
2+
var number: AnyObject
43

5-
init(number:AnyObject){
4+
init(number:AnyObject) {
65
self.number = number
76
}
87

9-
convenience init(integer:Int){
10-
self.init(number:integer)
8+
convenience init(integer: Int) {
9+
self.init(number: integer)
1110
}
1211

13-
convenience init(double:Double){
14-
self.init(number:double)
12+
convenience init(double: Double) {
13+
self.init(number: double)
1514
}
1615

17-
func integerValue() -> Int{
16+
func integerValue() -> Int {
1817
return self.number as Int
1918
}
2019

21-
func doubleValue() -> Double{
20+
func doubleValue() -> Double {
2221
return self.number as Double
2322
}
2423
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
class ThieveryCorporationPersonDisplay{
1+
class ThieveryCorporationPersonDisplay {
22

3-
var name:String?
4-
let font:String
3+
var name: String?
4+
let font: String
55

6-
init(font:String){
6+
init(font: String) {
77
self.font = font
88
}
99

10-
func clone() -> ThieveryCorporationPersonDisplay{
11-
return ThieveryCorporationPersonDisplay(font: self.font)
10+
func clone() -> ThieveryCorporationPersonDisplay {
11+
return ThieveryCorporationPersonDisplay(font:self.font)
1212
}
1313
}

Design-Patterns.playground/section-20.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ enum Country {
3030
class CurrencyFactory {
3131
class func currencyForCountry(country:Country) -> Currency? {
3232
switch country {
33-
case .Spain, .France :
34-
return Euro()
35-
case .UnitedStates :
36-
return UnitedStatedDolar()
37-
default:
38-
return nil
33+
case .Spain, .France :
34+
return Euro()
35+
case .UnitedStates :
36+
return UnitedStatedDolar()
37+
default:
38+
return nil
3939
}
4040

4141
}

Design-Patterns.playground/section-24.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Component
33
*/
44
protocol Shape {
5-
func draw(fillColor:String)
5+
func draw(fillColor: String)
66
}
77

88
/**

Design-Patterns.playground/section-28.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
class Eternal{
1+
class Eternal {
22

3-
class func setObject(value: AnyObject!, forKey defaultName: String!){
3+
class func setObject(value: AnyObject!, forKey defaultName: String!) {
44
let defaults:NSUserDefaults = NSUserDefaults.standardUserDefaults()
5-
defaults.setObject(value,forKey:defaultName)
5+
defaults.setObject(value, forKey:defaultName)
66
defaults.synchronize()
77
}
88

9-
class func objectForKey(defaultName: String!) -> AnyObject!{
9+
class func objectForKey(defaultName: String!) -> AnyObject! {
1010
let defaults:NSUserDefaults = NSUserDefaults.standardUserDefaults()
1111
return defaults.objectForKey(defaultName)
1212
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Eternal.setObject("Disconnect me. I’d rather be nothing",forKey:"Bishop")
1+
Eternal.setObject("Disconnect me. I’d rather be nothing", forKey:"Bishop")
22

33
Eternal.objectForKey("Bishop")

Design-Patterns.playground/section-32.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// WARNING: This example uses Point class from Builder pattern!
22

3-
class PointConverter{
3+
class PointConverter {
44

55
class func convert(#point:Point, base:Double, negative:Bool) -> Point{
66

Design-Patterns.playground/section-44.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ class Printer {
66

77
let strategy: PrintStrategy
88

9-
func printString(string:String)->String{
9+
func printString(string:String) -> String {
1010
return self.strategy.printString(string)
1111
}
1212

13-
init(strategy: PrintStrategy){
13+
init(strategy: PrintStrategy) {
1414
self.strategy = strategy
1515
}
1616
}
1717

18-
class UpperCaseStrategy: PrintStrategy{
19-
func printString(string:String)->String{
18+
class UpperCaseStrategy: PrintStrategy {
19+
func printString(string:String) -> String {
2020
return string.uppercaseString
2121
}
2222
}
2323

24-
class LowerCaseStrategy: PrintStrategy{
25-
func printString(string:String)->String{
24+
class LowerCaseStrategy: PrintStrategy {
25+
func printString(string:String) -> String {
2626
return string.lowercaseString
2727
}
2828
}
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
protocol ThreeDimensions {
2-
var x:Double? {get}
3-
var y:Double? {get}
4-
var z:Double? {get}
2+
var x: Double? {get}
3+
var y: Double? {get}
4+
var z: Double? {get}
55
}
66

7-
class Point:ThreeDimensions {
7+
class Point : ThreeDimensions {
88

9-
var x:Double?
10-
var y:Double?
11-
var z:Double?
9+
var x: Double?
10+
var y: Double?
11+
var z: Double?
1212

1313
typealias PointBuilderClosure = (Point) -> ()
1414

15-
init(buildClosure:PointBuilderClosure){
15+
init(buildClosure: PointBuilderClosure) {
1616
buildClosure(self)
1717
}
1818
}

Design-Patterns.playground/section-8.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
let fancyPoint = Point{ point in
1+
let fancyPoint = Point { point in
22
point.x = 0.1
33
point.y = 0.2
44
point.z = 0.3

0 commit comments

Comments
 (0)