This is an automated email from the ASF dual-hosted git repository.
moshen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git
The following commit(s) were added to refs/heads/master by this push:
new 91729bc [iOS] Clip module should be used in main thread.
new fba862c Merge pull request #3048 from wqyfavor/fix-clipboard
91729bc is described below
commit 91729bc8fe753fcd4f0f6e0ff93cf50cbe1b507c
Author: qianyuan.wqy <[email protected]>
AuthorDate: Mon Dec 2 15:55:51 2019 +0800
[iOS] Clip module should be used in main thread.
---
ios/sdk/WeexSDK/Sources/Module/WXClipboardModule.m | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXClipboardModule.m
b/ios/sdk/WeexSDK/Sources/Module/WXClipboardModule.m
index 7b7fcb1..c07d364 100644
--- a/ios/sdk/WeexSDK/Sources/Module/WXClipboardModule.m
+++ b/ios/sdk/WeexSDK/Sources/Module/WXClipboardModule.m
@@ -24,8 +24,8 @@
WX_EXPORT_METHOD(@selector(setString:))
WX_EXPORT_METHOD(@selector(getString:))
-- (dispatch_queue_t)targetExecuteQueue {
- return dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
+- (NSThread *)targetExecuteThread {
+ return [NSThread mainThread];
}
- (void)setString:(NSString *)content
@@ -37,9 +37,10 @@ WX_EXPORT_METHOD(@selector(getString:))
- (void)getString:(WXModuleKeepAliveCallback)callback{
UIPasteboard *clipboard = [UIPasteboard generalPasteboard];
NSDictionary *result = [@{} mutableCopy];
- if(clipboard.string)
+ NSString* content = [clipboard string];
+ if(content)
{
- [result setValue:clipboard.string forKey:@"data"];
+ [result setValue:content forKey:@"data"];
[result setValue:@"success" forKey:@"result"];
}else
{