Skip to content

Commit

Permalink
Merge branch 'release/0.1.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeehut committed Dec 19, 2015
2 parents 3ca31ab + 14e06b5 commit 29e310c
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 35 deletions.
8 changes: 0 additions & 8 deletions HandySwift/Extensions/IntegerTypeExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,4 @@ public extension IntegerType {
}
}

public func times(closure: (Self) -> ()) {
guard self > 0 else { return }

for i in 1...self {
closure(i)
}
}

}
19 changes: 1 addition & 18 deletions HandySwiftTests/Extensions/IntegerTypeExtensionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import XCTest

class IntegerTypeExtensionTests: XCTestCase {

func testTimesClosureWithoutArgument() {
func testTimesMethod() {
var testString = ""

0.times {
Expand All @@ -28,21 +28,4 @@ class IntegerTypeExtensionTests: XCTestCase {
XCTAssertEqual(testString, "...")
}

func testTimesClosureWithArgument() {
var testString = ""

0.times { i in
testString += "\(i)"
}

XCTAssertEqual(testString, "")

3.times { i in
testString += "\(i)"
}

XCTAssertEqual(testString, "123")
}


}
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ Please have a look at the UsageExamples.playground for a complete list of featur
// => ["Hello World!", "Hello World!", "Hello World!"]
```

``` Swift
3.times{ array.append("Hello World #\($0)!") }
// => ["Hello World #1!", "Hello World #2!", "Hello World #3!"]
```

## Contributing

Contributions are welcome. Please just open an Issue on GitHub to discuss a point or request a feature or send a Pull Request with your suggestion. If there's a related discussion on the Swift Evolution mailing list, please also post the thread name with a link.
Expand Down
4 changes: 0 additions & 4 deletions UsageExamples.playground/Contents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,5 @@ var array: [String] = []
3.times{ array.append("Hello World!") }
array

array = []
3.times{ array.append("Hello World #\($0)!") }
array



0 comments on commit 29e310c

Please sign in to comment.