mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(devtools-ios): Ensure UI modifications run on main thread
Modifications to the UI can only be made from the main thread.
Since {N} 5.3.0 all debugger protocol messages are processed
by the worker thread that receives them in iOS.
refs #7219, https://github.com/NativeScript/ios-runtime/pull/1101
This commit is contained in:
@@ -159,6 +159,14 @@ export function openUrl(location: string): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
export function executeOnMainThread(func: () => void) {
|
||||
NSOperationQueue.mainQueue.addOperationWithBlock(func);
|
||||
}
|
||||
|
||||
export function isMainThread(): Boolean {
|
||||
return NSThread.isMainThread;
|
||||
}
|
||||
|
||||
class UIDocumentInteractionControllerDelegateImpl extends NSObject implements UIDocumentInteractionControllerDelegate {
|
||||
public static ObjCProtocols = [UIDocumentInteractionControllerDelegate];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user