I would like to remove the ability to select the text in a TouchScreenKeyboard text field (IOS), or disable the ability to lookup the text (see attached picture). I've seen some answer here on Stackoverflow talking about it but i'ts not for Unity.
Should i create a native plugin or is there an easier way to do this?
Some sources on similar issues:
How to remove lookup & share from textview in Swift 3
How to disable copy paste option from UITextField programmatically
Thanks!
EDIT:
A solution which is not optimal is to edit the Xcode project that is generated by Unity when building:
Open the Xcode project and add these two files NonLookupField.h and NonLookupField.m in Classes --> UI
NonLookupField.h
#import <UIKit/UIKit.h>
@interface NonLookupField : UITextField
@end
NonLookupField.m
#import <Foundation/Foundation.h>
#import "NonLookupField.h"
@implementation NonLookupField
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
if (action == @selector(copy:) ||
action == @selector(selectAll:)) {
return true;
}
return false;
}
@end
Replace all instances of UITextField with the newly created NonLookupField in keyboard.mm