Skip to content

Commit b3c4f55

Browse files
committed
Fix adaptToKeyboard for iOS 14
1 parent 00fca04 commit b3c4f55

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/SwiftUIKit/extensions/adaptToKeyboard.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ import Combine
1111

1212
public extension View {
1313
func adaptToKeyboard() -> some View {
14-
modifier(AdaptToSoftwareKeyboard())
14+
if #available(iOS 14.0, *) {
15+
// iOS 14 (beta 6 +) does it automatically
16+
return AnyView(self.animation(.spring()))
17+
} else {
18+
return AnyView(modifier(AdaptToSoftwareKeyboard()))
19+
}
1520
}
1621
}
1722

0 commit comments

Comments
 (0)