Hi! 👋
Firstly, thanks for your work on this project! 🙂
- When building an ios app with the package the build would stop due to this error: 'keyboardLayoutGuide' is only available in iOS 15.0 or newer, fixed it for my app with this solution.
Here is the diff that solved my problem:
diff --git a/node_modules/react-native-keyboard-controller/ios/observers/KeyboardTrackingView.swift b/node_modules/react-native-keyboard-controller/ios/observers/KeyboardTrackingView.swift
index 95ab759..39cf62e 100644
--- a/node_modules/react-native-keyboard-controller/ios/observers/KeyboardTrackingView.swift
+++ b/node_modules/react-native-keyboard-controller/ios/observers/KeyboardTrackingView.swift
@@ -66,16 +66,18 @@ final class KeyboardTrackingView: UIView {
translatesAutoresizingMaskIntoConstraints = false
- if #available(iOS 17.0, *) {
- rootView.keyboardLayoutGuide.usesBottomSafeArea = false
+ if #available(iOS 15.0, *) {
+ if #available(iOS 17.0, *) {
+ rootView.keyboardLayoutGuide.usesBottomSafeArea = false
+ }
+
+ NSLayoutConstraint.activate([
+ leadingAnchor.constraint(equalTo: rootView.leadingAnchor, constant: 0),
+ trailingAnchor.constraint(equalTo: rootView.trailingAnchor, constant: 0),
+ bottomAnchor.constraint(equalTo: rootView.keyboardLayoutGuide.topAnchor, constant: 0),
+ heightAnchor.constraint(equalToConstant: 0),
+ ])
}
-
- NSLayoutConstraint.activate([
- leadingAnchor.constraint(equalTo: rootView.leadingAnchor, constant: 0),
- trailingAnchor.constraint(equalTo: rootView.trailingAnchor, constant: 0),
- bottomAnchor.constraint(equalTo: rootView.keyboardLayoutGuide.topAnchor, constant: 0),
- heightAnchor.constraint(equalToConstant: 0),
- ])
}
@objc private func keyboardWillAppear(_ notification: Notification) {
This issue body was partially generated by patch-package.
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Here is the diff that solved my problem:
This issue body was partially generated by patch-package.