missing copy/paste menu in UITextField/UIWebView
I had the same problem – everything else was working correctly, but all UITextView
s were missing "copy / paste / select" menu, globally, through all application.
After some experimenting, I've found that the cause was either:
"Visible at Launch" property not set on a Window in MainWindow.xib
OR
Missing call to [self.window makeKeyAndVisible]
inside application:didFinishLaunchingWithOptions:
method of AppDelegate.
It works fine after fixing any of those. Try it.
If you work with Xcode 11+ and iOS 13+ projects (and SceneDelegate
),
make sure that you apply changes in that exact order:
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow()
window!.rootViewController = rootNavigation
window!.windowScene = windowScene
window!.makeKeyAndVisible()
}
}
because, if you will apply it something like that:
window!.makeKeyAndVisible()
window!.windowScene = windowScene
you will have described in question problem. It will appear and look fine, work, but copy-paste actions will not appear. It took me a while to find this out.