diff --git a/Sources/UIDeviceExtensions.swift b/Sources/UIDeviceExtensions.swift index 048156c..9c5a1e5 100644 --- a/Sources/UIDeviceExtensions.swift +++ b/Sources/UIDeviceExtensions.swift @@ -65,10 +65,6 @@ public extension UIDeviceComplete where Base == UIDevice { var isSimulator: Bool { return deviceFamily == .simulator } - - var hasNotch: Bool { - return deviceModel.hasNotch - } } diff --git a/Tests/DeviceModelTests.swift b/Tests/DeviceModelTests.swift index 228ec74..0276e71 100644 --- a/Tests/DeviceModelTests.swift +++ b/Tests/DeviceModelTests.swift @@ -311,5 +311,14 @@ class DeviceModelTests: XCTestCase { XCTAssert(deviceModel == .unknown , "DeviceModel - .unknown is failing") } - + + // MARK: Notch test + func testHasNotch() { + let notchModels: [DeviceModel] = [.iPhoneX, .iPhoneXS, .iPhoneXSMax, .iPhoneXR] + + let noNotchModels: [DeviceModel] = DeviceModel.allCases.filter( { !notchModels.contains($0) }) + + notchModels.forEach { XCTAssertTrue($0.hasNotch) } + noNotchModels.forEach { XCTAssertFalse($0.hasNotch) } + } } diff --git a/Tests/UIDeviceExtensionsTests.swift b/Tests/UIDeviceExtensionsTests.swift index 76a07e1..0c87d98 100644 --- a/Tests/UIDeviceExtensionsTests.swift +++ b/Tests/UIDeviceExtensionsTests.swift @@ -55,14 +55,4 @@ class UIDeviceExtensionsTests: XCTestCase { let deviceFamily = DeviceFamily(rawValue: "x86_64") XCTAssert(deviceFamily == .simulator, "DeviceExtensions - .isSimulator is failing") } - - - func testHasNotch() { - let notchModels: [DeviceModel] = [.iPhoneX, .iPhoneXS, .iPhoneXSMax, .iPhoneXR] - - let noNotchModels: [DeviceModel] = DeviceModel.allCases.filter( { !notchModels.contains($0) }) - - notchModels.forEach { XCTAssertTrue($0.hasNotch) } - noNotchModels.forEach { XCTAssertFalse($0.hasNotch) } - } }