Skip to content

Commit ca26c0c

Browse files
committed
Update to Xcode 7.3.
1 parent dc27931 commit ca26c0c

File tree

9 files changed

+25
-38
lines changed

9 files changed

+25
-38
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
#
77
# Pods/
88

9+
.DS_Store

Design-Patterns.playground.zip

5.95 KB
Binary file not shown.

Design-Patterns.playground/Pages/Behavioral.xcplaygroundpage/Contents.swift

+4-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ class MoneyPile {
3030
self.nextPile = nextPile
3131
}
3232

33-
func canWithdraw(var v: Int) -> Bool {
33+
func canWithdraw(v: Int) -> Bool {
34+
35+
var v = v
3436

3537
func canTakeSomeBill(want: Int) -> Bool {
3638
return (want / self.value) > 0
@@ -272,7 +274,7 @@ extension NovellasCollection: SequenceType {
272274

273275
func generate() -> AnyGenerator<T> {
274276
var i = 0
275-
return anyGenerator{ return i >= self.novellas.count ? nil : self.novellas[i++] }
277+
return AnyGenerator { i += 1; return i >= self.novellas.count ? nil : self.novellas[i] }
276278
}
277279
}
278280
/*:

Design-Patterns.playground/Pages/Behavioral.xcplaygroundpage/timeline.xctimeline

-6
This file was deleted.

Design-Patterns.playground/contents.xcplayground

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<playground version='6.0' target-platform='ios' requires-full-environment='true' display-mode='rendered'>
2+
<playground version='6.0' target-platform='ios' display-mode='rendered'>
33
<pages>
44
<page name='Behavioral'/>
55
<page name='Creational'/>

README.md

+14-26
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Design Patterns implemented in Swift 2
33
======================================
4-
A short cheat-sheet with Xcode 7beta Playground ([Design-Patterns.playground.zip](https://raw.githubusercontent.com/ochococo/Design-Patterns-In-Swift/master/Design-Patterns.playground.zip)).
4+
A short cheat-sheet with Xcode 7.3 Playground ([Design-Patterns.playground.zip](https://raw.githubusercontent.com/ochococo/Design-Patterns-In-Swift/master/Design-Patterns.playground.zip)).
55

66
👷 Project maintained by: [@nsmeme](http://twitter.com/nsmeme) (Oktawian Chojnacki)
77

@@ -11,13 +11,6 @@ A short cheat-sheet with Xcode 7beta Playground ([Design-Patterns.playground.zip
1111
* [Creational](#creational)
1212
* [Structural](#structural)
1313

14-
15-
```swift
16-
Behavioral |
17-
[Creational](Creational) |
18-
[Structural](Structural)
19-
```
20-
2114
Behavioral
2215
==========
2316

@@ -51,7 +44,9 @@ class MoneyPile {
5144
self.nextPile = nextPile
5245
}
5346

54-
func canWithdraw(var v: Int) -> Bool {
47+
func canWithdraw(v: Int) -> Bool {
48+
49+
var v = v
5550

5651
func canTakeSomeBill(want: Int) -> Bool {
5752
return (want / self.value) > 0
@@ -126,6 +121,7 @@ atm.canWithdraw(30) // Can withdraw - 1x20, 2x10
126121

127122
>**Further Examples:** [Design Patterns in Swift](https://github.com/kingreza/Swift-Chain-Of-Responsibility)
128123
124+
129125
👫 Command
130126
----------
131127

@@ -291,6 +287,7 @@ var result = expression?.evaluate(intContext)
291287

292288
>**Further Examples:** [Design Patterns in Swift](https://github.com/kingreza/Swift-Interpreter)
293289
290+
294291
🍫 Iterator
295292
-----------
296293

@@ -309,7 +306,7 @@ extension NovellasCollection: SequenceType {
309306

310307
func generate() -> AnyGenerator<T> {
311308
var i = 0
312-
return anyGenerator{ return i >= self.novellas.count ? nil : self.novellas[i++] }
309+
return AnyGenerator { i += 1; return i >= self.novellas.count ? nil : self.novellas[i] }
313310
}
314311
}
315312
```
@@ -397,6 +394,7 @@ user0.send("Hello") // user1 receives message
397394

398395
>**Further Examples:** [Design Patterns in Swift](https://github.com/kingreza/Swift-Mediator)
399396
397+
400398
💾 Memento
401399
----------
402400

@@ -534,6 +532,7 @@ testChambers.testChamberNumber++
534532

535533
>**Further Examples:** [Design Patterns in Swift](https://github.com/kingreza/Swift-Observer)
536534
535+
537536
🐉 State
538537
---------
539538

@@ -649,11 +648,11 @@ lower.printString("O tempora, o mores!")
649648

650649
var upper = Printer(strategy:UpperCaseStrategy())
651650
upper.printString("O tempora, o mores!")
652-
653651
```
654652

655653
>**Further Examples:** [Design Patterns in Swift](https://github.com/kingreza/Swift-Strategy)
656654
655+
657656
🏃 Visitor
658657
----------
659658

@@ -706,14 +705,9 @@ let names = planets.map { (planet: Planet) -> String in
706705

707706
names
708707
```
709-
>**Further Examples:** [Design Patterns in Swift](https://github.com/kingreza/Swift-Visitor)
710708

711-
```swift
709+
>**Further Examples:** [Design Patterns in Swift](https://github.com/kingreza/Swift-Visitor)
712710
713-
[Behavioral](Behavioral) |
714-
Creational |
715-
[Structural](Structural)
716-
```
717711

718712
Creational
719713
==========
@@ -736,9 +730,6 @@ The "family" of objects created by the factory are determined at run-time.
736730

737731
### Example
738732

739-
```swift
740-
741-
```
742733

743734
Protocols
744735

@@ -980,6 +971,7 @@ Eduardo.name = "Eduardo"
980971

981972
>**Further Examples:** [Design Patterns in Swift](https://github.com/kingreza/Swift-Prototype)
982973
974+
983975
💍 Singleton
984976
------------
985977

@@ -1005,9 +997,7 @@ class DeathStarSuperlaser {
1005997
```swift
1006998

1007999
let laser = DeathStarSuperlaser.sharedInstance
1008-
[Behavioral](Behavioral) |
1009-
[Creational](Creational) |
1010-
Structural
1000+
10111001
```
10121002

10131003
Structural
@@ -1087,6 +1077,7 @@ oldFormat.angleV
10871077

10881078
>**Further Examples:** [Design Patterns in Swift](https://github.com/kingreza/Swift-Adapter)
10891079
1080+
10901081
🌉 Bridge
10911082
----------
10921083

@@ -1148,9 +1139,6 @@ The composite pattern is used to create hierarchical, recursive tree structures
11481139

11491140
### Example
11501141

1151-
```swift
1152-
1153-
```
11541142

11551143
Component
11561144

source/behavioral/chain_of_responsibility.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ class MoneyPile {
1717
self.nextPile = nextPile
1818
}
1919

20-
func canWithdraw(var v: Int) -> Bool {
20+
func canWithdraw(v: Int) -> Bool {
21+
22+
var v = v
2123

2224
func canTakeSomeBill(want: Int) -> Bool {
2325
return (want / self.value) > 0

source/behavioral/iterator.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ extension NovellasCollection: SequenceType {
1515

1616
func generate() -> AnyGenerator<T> {
1717
var i = 0
18-
return anyGenerator{ return i >= self.novellas.count ? nil : self.novellas[i++] }
18+
return AnyGenerator { i += 1; return i >= self.novellas.count ? nil : self.novellas[i] }
1919
}
2020
}
2121
/*:

source/header.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Design Patterns implemented in Swift 2
33
======================================
4-
A short cheat-sheet with Xcode 7beta Playground ([Design-Patterns.playground.zip](https://raw.githubusercontent.com/ochococo/Design-Patterns-In-Swift/master/Design-Patterns.playground.zip)).
4+
A short cheat-sheet with Xcode 7.3 Playground ([Design-Patterns.playground.zip](https://raw.githubusercontent.com/ochococo/Design-Patterns-In-Swift/master/Design-Patterns.playground.zip)).
55

66
👷 Project maintained by: [@nsmeme](http://twitter.com/nsmeme) (Oktawian Chojnacki)
77

0 commit comments

Comments
 (0)