fix(ios): Clipboard get/set missing implement

(cherry picked from commit 6db3e074c5)
This commit is contained in:
Kyoz 2021-08-30 16:12:45 +07:00 committed by Rémi Verschelde
parent 20ec596a5d
commit e4df8a68fa
No known key found for this signature in database
GPG key ID: C3336907360768E1
2 changed files with 13 additions and 0 deletions

View file

@ -110,6 +110,9 @@ public:
virtual String get_name() const;
virtual String get_model_name() const;
virtual void set_clipboard(const String &p_text);
virtual String get_clipboard() const;
Error shell_open(String p_uri);
String get_user_data_dir() const;

View file

@ -466,6 +466,16 @@ String OSIPhone::get_name() const {
return "iOS";
}
void OSIPhone::set_clipboard(const String &p_text) {
[UIPasteboard generalPasteboard].string = [NSString stringWithUTF8String:p_text.utf8()];
}
String OSIPhone::get_clipboard() const {
NSString *text = [UIPasteboard generalPasteboard].string;
return String::utf8([text UTF8String]);
}
String OSIPhone::get_model_name() const {
String model = ios->get_model();
if (model != "") {