Skip to content

Commit

Permalink
Merge branch 'deploy/2.1.0' into productive
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeehut committed Feb 13, 2017
2 parents b7a1fd9 + 30efb02 commit 4a85a3a
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 9 deletions.
2 changes: 1 addition & 1 deletion HandySwift.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "HandySwift"
s.version = "2.0.1"
s.version = "2.1.0"
s.summary = "Handy Swift features that didn't make it into the Swift standard library"

s.description = <<-DESC
Expand Down
8 changes: 8 additions & 0 deletions HandySwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
826F69B01C389DB800B2CC6B /* FrequencyTableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 826F69AF1C389DB800B2CC6B /* FrequencyTableTests.swift */; };
826F69B11C389DB800B2CC6B /* FrequencyTableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 826F69AF1C389DB800B2CC6B /* FrequencyTableTests.swift */; };
826F69B21C389DB800B2CC6B /* FrequencyTableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 826F69AF1C389DB800B2CC6B /* FrequencyTableTests.swift */; };
827599641E520FB800787F99 /* DispatchTimeIntervalExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 827599631E520FB800787F99 /* DispatchTimeIntervalExtensionTests.swift */; };
827599651E520FB800787F99 /* DispatchTimeIntervalExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 827599631E520FB800787F99 /* DispatchTimeIntervalExtensionTests.swift */; };
827599661E520FB800787F99 /* DispatchTimeIntervalExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 827599631E520FB800787F99 /* DispatchTimeIntervalExtensionTests.swift */; };
8280D7DC1C4A6EC9001172EF /* DictionaryExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8280D7DB1C4A6EC9001172EF /* DictionaryExtension.swift */; };
8280D7DD1C4A6EC9001172EF /* DictionaryExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8280D7DB1C4A6EC9001172EF /* DictionaryExtension.swift */; };
8280D7DE1C4A6EC9001172EF /* DictionaryExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8280D7DB1C4A6EC9001172EF /* DictionaryExtension.swift */; };
Expand Down Expand Up @@ -116,6 +119,7 @@
825EFDF21C33351300558497 /* HandySwift tvOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "HandySwift tvOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
826F69AB1C3895A300B2CC6B /* FrequencyTable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FrequencyTable.swift; sourceTree = "<group>"; };
826F69AF1C389DB800B2CC6B /* FrequencyTableTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FrequencyTableTests.swift; sourceTree = "<group>"; };
827599631E520FB800787F99 /* DispatchTimeIntervalExtensionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DispatchTimeIntervalExtensionTests.swift; sourceTree = "<group>"; };
8280D7DB1C4A6EC9001172EF /* DictionaryExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DictionaryExtension.swift; sourceTree = "<group>"; };
8280D7DF1C4A6FF3001172EF /* DictionaryExtensionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DictionaryExtensionTests.swift; sourceTree = "<group>"; };
82812A9A1D06877B00CD5B6C /* Globals.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Globals.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -228,6 +232,7 @@
82CAE2971C2EE95200F934A7 /* ArrayExtensionTests.swift */,
825EFDC21C332AD200558497 /* CharacterViewExtensionTests.swift */,
8280D7DF1C4A6FF3001172EF /* DictionaryExtensionTests.swift */,
827599631E520FB800787F99 /* DispatchTimeIntervalExtensionTests.swift */,
);
path = Extensions;
sourceTree = "<group>";
Expand Down Expand Up @@ -614,6 +619,7 @@
buildActionMask = 2147483647;
files = (
826F69B01C389DB800B2CC6B /* FrequencyTableTests.swift in Sources */,
827599641E520FB800787F99 /* DispatchTimeIntervalExtensionTests.swift in Sources */,
825EFDC31C332AD200558497 /* CharacterViewExtensionTests.swift in Sources */,
8258E4591C2E1ACE0031CBFF /* SortedArrayTests.swift in Sources */,
825EFDC11C332ABB00558497 /* IntegerTypeExtensionTests.swift in Sources */,
Expand Down Expand Up @@ -647,6 +653,7 @@
buildActionMask = 2147483647;
files = (
826F69B11C389DB800B2CC6B /* FrequencyTableTests.swift in Sources */,
827599651E520FB800787F99 /* DispatchTimeIntervalExtensionTests.swift in Sources */,
825EFE131C3335A400558497 /* CharacterViewExtensionTests.swift in Sources */,
825EFE111C3335A400558497 /* StringExtensionTests.swift in Sources */,
825EFE0E1C3335A400558497 /* SortedArrayTests.swift in Sources */,
Expand Down Expand Up @@ -680,6 +687,7 @@
buildActionMask = 2147483647;
files = (
826F69B21C389DB800B2CC6B /* FrequencyTableTests.swift in Sources */,
827599661E520FB800787F99 /* DispatchTimeIntervalExtensionTests.swift in Sources */,
825EFE191C3335A500558497 /* CharacterViewExtensionTests.swift in Sources */,
825EFE171C3335A500558497 /* StringExtensionTests.swift in Sources */,
825EFE141C3335A500558497 /* SortedArrayTests.swift in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

**Copyright (c) 2015-2016 Flinesoft**
**Copyright (c) 2015-2017 Flinesoft**

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
alt="codebeat badge">
</a>
<a href="https://github.com/Flinesoft/HandySwift/releases">
<img src="https://img.shields.io/badge/Version-2.0.1-blue.svg"
alt="Version: 2.0.1">
<img src="https://img.shields.io/badge/Version-2.1.0-blue.svg"
alt="Version: 2.1.0">
</a>
<img src="https://img.shields.io/badge/Swift-3.0-FFAC45.svg"
alt="Swift: 3.0">
Expand Down Expand Up @@ -56,7 +56,7 @@ You can of course also just include this framework manually into your project by
Place the following line to your Cartfile:

``` Swift
github "Flinesoft/HandySwift"
github "Flinesoft/HandySwift" ~> 2.1
```

Now run `carthage update`. Then drag & drop the HandySwift.framework in the Carthage/build folder to your project. Now you can `import HandySwift` in each class you want to use its features. Refer to the [Carthage README](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application) for detailed / updated instructions.
Expand All @@ -71,7 +71,7 @@ platform :ios, '8.0'
use_frameworks!

target 'MyAppTarget' do
pod 'HandySwift', '~> 1.0'
pod 'HandySwift', '~> 2.1'
end
```

Expand All @@ -94,6 +94,7 @@ Open the Playground from within the `.xcworkspace` in order for it to work.
- [StringExtension](#stringextension)
- [ArrayExtension](#arrayextension)
- [DictionaryExtension](#dictionaryextension)
- [DispatchTimeIntervalExtension](#dispatchtimeintervalextension)
- New types
- [SortedArray](#sortedarray)
- [FrequencyTable](#frequencytable)
Expand Down Expand Up @@ -197,7 +198,6 @@ Returns an array with `size` random elements or nil if array empty.
([] as [Int]).sample(size: 3) // => nil
```


#### .combinations(with:)

Combines each element with each element of a given other array.
Expand All @@ -207,6 +207,7 @@ Combines each element with each element of a given other array.
// => [(1, "A"), (1, "B"), (2, "A"), (2, "B"), (3, "A"), (3, "B")]
```


### DictionaryExtension
#### init?(keys:values:)

Expand Down Expand Up @@ -242,6 +243,16 @@ immutableDict.merged(with: ["B": "New B value", "C": "C value"])
// => ["A": "A value", "B": "New B value", "C": "C value"]
```

### DispatchTimeIntervalExtension
#### .timeInterval

Returns a `TimeInterval` object from a `DispatchTimeInterval`.

``` Swift
DispatchTimeInterval.milliseconds(500).timeInterval // => 0.5
```


### SortedArray

The main purpose of this wrapper is to provide speed improvements for specific actions on sorted arrays.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Extensions/DispatchTimeIntervalExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public typealias Timespan = DispatchTimeInterval

extension Timespan {
/// - Returns: The time in seconds using the`TimeInterval` type.
var timeInterval: TimeInterval {
public var timeInterval: TimeInterval {
switch self {
case .seconds(let seconds):
return Double(seconds)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Supporting Files/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.0.1</string>
<string>2.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
20 changes: 20 additions & 0 deletions Tests/Extensions/DispatchTimeIntervalExtensionTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// DispatchTimeIntervalExtensionTests.swift
// HandySwift
//
// Created by Cihat Gündüz on 13.02.17.
// Copyright © 2017 Flinesoft. All rights reserved.
//

import XCTest

@testable import HandySwift

class DispatchTimeIntervalTests: XCTestCase {
func testTimeInterval() {
let dispatchTimeInterval = DispatchTimeInterval.milliseconds(500)
let timeInterval = dispatchTimeInterval.timeInterval

XCTAssertEqualWithAccuracy(timeInterval, 0.5, accuracy: 0.001)
}
}
6 changes: 6 additions & 0 deletions UsageExamples.playground/Contents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ mergedDict
//: Combines each element with each element of a given other array.
[1, 2, 3].combinations(with: ["A", "B"])

//: ## DispatchTimeIntervalExtension
//: ### .timeInterval
//: Returns a `TimeInterval` object from a `DispatchTimeInterval`.

DispatchTimeInterval.milliseconds(500).timeInterval

//: # Added Structures
//: New structures added to extend the Swift standard library.
//: ## SortedArray
Expand Down

0 comments on commit 4a85a3a

Please sign in to comment.