mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +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:
20
tns-core-modules/utils/utils.d.ts
vendored
20
tns-core-modules/utils/utils.d.ts
vendored
@ -269,6 +269,26 @@ export function GC();
|
||||
*/
|
||||
export function releaseNativeObject(object: any /*java.lang.Object | NSObject*/);
|
||||
|
||||
/**
|
||||
* Dispatches the passed function for execution on the main thread
|
||||
* @param func The function to execute on the main thread.
|
||||
*/
|
||||
export function executeOnMainThread(func: Function);
|
||||
|
||||
/**
|
||||
* Returns a function wrapper which executes the supplied function on the main thread.
|
||||
* The wrapper behaves like the original function and passes all of its arguments BUT
|
||||
* discards its return value.
|
||||
* @param func The function to execute on the main thread
|
||||
* @returns The wrapper function which schedules execution to the main thread
|
||||
*/
|
||||
export function mainThreadify(func: Function): (...args: any[]) => void
|
||||
|
||||
/**
|
||||
* @returns Boolean value indicating whether the current thread is the main thread
|
||||
*/
|
||||
export function isMainThread(): boolean
|
||||
|
||||
/**
|
||||
* Returns true if the specified path points to a resource or local file.
|
||||
* @param path The path.
|
||||
|
Reference in New Issue
Block a user