Skip to content

Add tvOS support #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ let package = Package(
name: "YCoreUI",
defaultLocalization: "en",
platforms: [
.iOS(.v14)
.iOS(.v14),
.tvOS(.v14)
],
products: [
.library(
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions Sources/YCoreUI/Components/FormViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -154,3 +155,4 @@ internal extension FormViewController {
handleTapOutside()
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import UIKit

#if os(iOS)
extension UIScrollView {
/// Enables form functionality (content avoids keyboard, sets interactive dismiss mode).
/// This calls `registerKeyboardNotifications`
Expand Down Expand Up @@ -130,3 +131,4 @@ internal extension UIScrollView {
return UIView.AnimationOptions(rawValue: animationCurve.uintValue << 16)
}
}
#endif
2 changes: 2 additions & 0 deletions Tests/YCoreUITests/Components/FormViewControllerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import XCTest
@testable import YCoreUI

#if os(iOS)
final class FormViewControllerTests: XCTestCase {
func testLoadView() {
let sut = makeSUT()
Expand Down Expand Up @@ -151,3 +152,4 @@ final class MockFormViewController: FormViewController {
didTapOutside = true
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import XCTest
@testable import YCoreUI

#if os(iOS)
final class UIScrollViewKeyboardNotificationsTests: XCTestCase {
func testShowKeyboard() {
let sut = makeSUT()
Expand Down Expand Up @@ -161,3 +162,4 @@ private extension UIScrollViewKeyboardNotificationsTests {
RunLoop.current.run(until: Date())
}
}
#endif