Skip to content

Commit 7ccca81

Browse files
committed
~Minor improvement.
1 parent f5480e0 commit 7ccca81

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Design-Patterns.playground.zip

0 Bytes
Binary file not shown.

Design-Patterns.playground/section-24.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Circle : Shape {
2626
class Whiteboard : Shape {
2727
lazy var shapes = [Shape]()
2828

29-
init(_ shapes:[Shape]) {
29+
init(_ shapes:Shape...) {
3030
self.shapes = shapes
3131
}
3232

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
var whiteboard = Whiteboard([Circle(), Square()])
1+
var whiteboard = Whiteboard(Circle(), Square())
22
whiteboard.draw("Red")

README.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ class Circle : Shape {
244244
class Whiteboard : Shape {
245245
lazy var shapes = [Shape]()
246246

247-
init(_ shapes:[Shape]) {
247+
init(_ shapes:Shape...) {
248248
self.shapes = shapes
249249
}
250250

@@ -257,7 +257,7 @@ class Whiteboard : Shape {
257257
```
258258
**Usage:**
259259
```swift
260-
var whiteboard = Whiteboard([Circle(), Square()])
260+
var whiteboard = Whiteboard(Circle(), Square())
261261
whiteboard.draw("Red")
262262
```
263263

0 commit comments

Comments
 (0)