I am trying to bring a UIView in front of keyboard. It is working fine when compiled and run using Xcode 13, but same piece of code isn't working in Xcode 14 (Using Xcode 14.2). Below is the code I am using:
let customView = UIView(frame: CGRect(x: 100, y: 100, width: 200, height: 200))
customView.backgroundColor = UIColor.clear
customView.layer.zPosition = CGFloat(Float.greatestFiniteMagnitude)
guard let window = UIApplication.shared.windows.last else { return }
window.addSubview(customView)
Any help would be appreciated!