Hello Niklas,
In iOS 14, Apple fixed this issue. So i think you only need to keep the code to run in iOS 12 & 13 with below code inside onKeyboardShows function. And it should well cater the iOS 12–13 cases.
if #available(iOS 12.0, *) {
if #available(iOS 14.0, *) {
} else {
lastContentOffset = webView.scrollView.contentOffset
}
}
Happy coding ;)