Files
simplex-chat/apps/ios/Shared/Views/Helpers/KeyboardPadding.swift
Evgeny Poberezkin b69916a3a3 ios: fix iOS 17 keyboard (#2671)
* ios: hide keyboard on scroll

* fix

* fix keyboard covering view with conditional padding
2023-07-10 13:53:46 +01:00

22 lines
478 B
Swift

//
// KeyboardPadding.swift
// SimpleX (iOS)
//
// Created by Evgeny on 10/07/2023.
// Copyright © 2023 SimpleX Chat. All rights reserved.
//
import SwiftUI
extension View {
@ViewBuilder func keyboardPadding() -> some View {
if #available(iOS 17.0, *) {
GeometryReader { g in
self.padding(.bottom, max(0, ChatModel.shared.keyboardHeight - g.safeAreaInsets.bottom))
}
} else {
self
}
}
}