diff --git a/Package.swift b/Package.swift index 04ef3bb..64ab5e8 100644 --- a/Package.swift +++ b/Package.swift @@ -6,7 +6,8 @@ let package = Package( name: "YCoreUI", defaultLocalization: "en", platforms: [ - .iOS(.v14) + .iOS(.v14), + .tvOS(.v14) ], products: [ .library( diff --git a/README.md b/README.md index dc6e505..27bcb8e 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ _Core components for iOS to accelerate building user interfaces in code._ This lightweight framework primarily comprises: * UIView extensions for declarative Auto Layout - * UIScrollView extensions to assist with keyboard avoidance * UIColor extensions for WCAG 2.0 contrast ratio calculations - + * (iOS only) UIScrollView extensions to assist with keyboard avoidance + It also contains miscellaneous other Foundation and UIKit extensions. Documentation diff --git a/Sources/YCoreUI/Components/FormViewController.swift b/Sources/YCoreUI/Components/FormViewController.swift index 95d4561..b45ab73 100644 --- a/Sources/YCoreUI/Components/FormViewController.swift +++ b/Sources/YCoreUI/Components/FormViewController.swift @@ -8,6 +8,7 @@ import UIKit +#if os(iOS) /// A view controller with a scrollable content area that will automatically avoid the keyboard for you. /// A good choice for views that have inputs (e.g. login or onboarding). open class FormViewController: UIViewController { @@ -154,3 +155,4 @@ internal extension FormViewController { handleTapOutside() } } +#endif diff --git a/Sources/YCoreUI/Extensions/UIKit/UIScrollView+keyboardNotifications.swift b/Sources/YCoreUI/Extensions/UIKit/UIScrollView+keyboardNotifications.swift index cf40653..425b67a 100644 --- a/Sources/YCoreUI/Extensions/UIKit/UIScrollView+keyboardNotifications.swift +++ b/Sources/YCoreUI/Extensions/UIKit/UIScrollView+keyboardNotifications.swift @@ -8,6 +8,7 @@ import UIKit +#if os(iOS) extension UIScrollView { /// Enables form functionality (content avoids keyboard, sets interactive dismiss mode). /// This calls `registerKeyboardNotifications` @@ -130,3 +131,4 @@ internal extension UIScrollView { return UIView.AnimationOptions(rawValue: animationCurve.uintValue << 16) } } +#endif diff --git a/Tests/YCoreUITests/Components/FormViewControllerTests.swift b/Tests/YCoreUITests/Components/FormViewControllerTests.swift index a651744..63cbcca 100644 --- a/Tests/YCoreUITests/Components/FormViewControllerTests.swift +++ b/Tests/YCoreUITests/Components/FormViewControllerTests.swift @@ -9,6 +9,7 @@ import XCTest @testable import YCoreUI +#if os(iOS) final class FormViewControllerTests: XCTestCase { func testLoadView() { let sut = makeSUT() @@ -151,3 +152,4 @@ final class MockFormViewController: FormViewController { didTapOutside = true } } +#endif diff --git a/Tests/YCoreUITests/Extensions/UIKit/UIScrollView+keyboardNotificationsTests.swift b/Tests/YCoreUITests/Extensions/UIKit/UIScrollView+keyboardNotificationsTests.swift index 5cb7fcf..9b7ae34 100644 --- a/Tests/YCoreUITests/Extensions/UIKit/UIScrollView+keyboardNotificationsTests.swift +++ b/Tests/YCoreUITests/Extensions/UIKit/UIScrollView+keyboardNotificationsTests.swift @@ -9,6 +9,7 @@ import XCTest @testable import YCoreUI +#if os(iOS) final class UIScrollViewKeyboardNotificationsTests: XCTestCase { func testShowKeyboard() { let sut = makeSUT() @@ -161,3 +162,4 @@ private extension UIScrollViewKeyboardNotificationsTests { RunLoop.current.run(until: Date()) } } +#endif