Skip to content

Commit 5801833

Browse files
committed
Merge branch 'release/2.0.1'
2 parents 9da8549 + 4536fc7 commit 5801833

9 files changed

Lines changed: 60 additions & 13 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import PackageDescription
3434
let package = Package(
3535
name: "HelloWorld",
3636
dependencies: [
37-
.Package(url: "https://github.com/bojan/Thingy.git", "2.0.0")
37+
.Package(url: "https://github.com/bojan/Thingy.git", "2.0.1")
3838
]
3939
)
4040
```

Sources/Display.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,15 @@ public struct Display {
103103
/// Color space.
104104
public var colorSpace: ColorSpace
105105
}
106+
107+
// MARK: - Screen size comparison
108+
109+
extension Display.Size: Comparable {
110+
public static func <(lhs: Display.Size, rhs: Display.Size) -> Bool {
111+
return lhs.rawValue < rhs.rawValue
112+
}
113+
114+
public static func ==(lhs: Display.Size, rhs: Display.Size) -> Bool {
115+
return lhs.rawValue == rhs.rawValue
116+
}
117+
}

Sources/Info-tvOS.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>2.0.0</string>
18+
<string>2.0.1</string>
1919
<key>CFBundleVersion</key>
20-
<string>6</string>
20+
<string>7</string>
2121
<key>NSPrincipalClass</key>
2222
<string></string>
2323
</dict>

Sources/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>2.0.0</string>
18+
<string>2.0.1</string>
1919
<key>CFBundleVersion</key>
20-
<string>6</string>
20+
<string>7</string>
2121
<key>NSPrincipalClass</key>
2222
<string></string>
2323
</dict>

Sources/RawDevice.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,4 +151,3 @@ extension RawDevice: Comparable {
151151
}
152152

153153
}
154-

Thingy.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |spec|
22
spec.name = "Thingy"
3-
spec.version = "2.0.0"
3+
spec.version = "2.0.1"
44
spec.summary = "Device detection and querying library."
55
spec.homepage = "https://github.com/bojan/Thingy"
66
spec.license = "MIT"

Thingy.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,8 @@
638638
CLANG_WARN_SUSPICIOUS_MOVE = YES;
639639
CLANG_WARN_UNREACHABLE_CODE = YES;
640640
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
641-
CURRENT_PROJECT_VERSION = 6;
642-
DYLIB_CURRENT_VERSION = 6;
641+
CURRENT_PROJECT_VERSION = 7;
642+
DYLIB_CURRENT_VERSION = 7;
643643
ENABLE_STRICT_OBJC_MSGSEND = YES;
644644
ENABLE_TESTABILITY = YES;
645645
GCC_NO_COMMON_BLOCKS = YES;
@@ -690,8 +690,8 @@
690690
CLANG_WARN_SUSPICIOUS_MOVE = YES;
691691
CLANG_WARN_UNREACHABLE_CODE = YES;
692692
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
693-
CURRENT_PROJECT_VERSION = 6;
694-
DYLIB_CURRENT_VERSION = 6;
693+
CURRENT_PROJECT_VERSION = 7;
694+
DYLIB_CURRENT_VERSION = 7;
695695
ENABLE_STRICT_OBJC_MSGSEND = YES;
696696
ENABLE_TESTABILITY = YES;
697697
GCC_NO_COMMON_BLOCKS = YES;

Unit Tests/ComparisonTests.swift

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,40 @@ class ComparisonTests: XCTestCase {
7676
XCTAssertThrows(expression: try lhs.isEqual(to: rhs))
7777
}
7878

79+
func testCompareScreenSize() {
80+
var device1 = Device.iPadMini2
81+
var device2 = Device.iPadPro12Inch2G
82+
83+
XCTAssertTrue(device1.displaySize < device2.displaySize)
84+
85+
device1 = Device.iPadMini2
86+
device2 = Device.iPadMini4
87+
88+
XCTAssertTrue(device1.displaySize <= device2.displaySize)
89+
90+
device1 = Device.iPadPro10Inch
91+
device2 = Device.iPadPro9Inch
92+
93+
XCTAssertFalse(device1.displaySize < device2.displaySize)
94+
95+
device1 = Device.iPad3
96+
device2 = Device.iPad5
97+
98+
XCTAssertTrue(device1.displaySize == device2.displaySize)
99+
100+
device1 = Device.iPhoneX
101+
device2 = Device.iPhone4S
102+
103+
XCTAssertTrue(device1.displaySize > device2.displaySize)
104+
105+
device1 = Device.iPhone8Plus
106+
device2 = Device.iPhone8
107+
108+
XCTAssertTrue(device1.displaySize >= device2.displaySize)
109+
110+
device1 = Device.iPhone7
111+
device2 = Device.iPhone7Plus
112+
113+
XCTAssertFalse(device1.displaySize > device2.displaySize)
114+
}
79115
}

Unit Tests/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<key>CFBundlePackageType</key>
1616
<string>BNDL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>2.0.0</string>
18+
<string>2.0.1</string>
1919
<key>CFBundleVersion</key>
20-
<string>6</string>
20+
<string>7</string>
2121
</dict>
2222
</plist>

0 commit comments

Comments
 (0)