File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ import PackageDescription
3434let 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```
Original file line number Diff line number Diff 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+ }
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change @@ -151,4 +151,3 @@ extension RawDevice: Comparable {
151151 }
152152
153153}
154-
Original file line number Diff line number Diff line change 11Pod ::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"
Original file line number Diff line number Diff line change 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;
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;
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff line change 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 >
You can’t perform that action at this time.
0 commit comments