# ScreenShare - UI API called on a background thread

**URL:** <https://devforum.zoom.us/t/screenshare-ui-api-called-on-a-background-thread/23748>\
**Category:** iOS\
**Created:** [July 10, 2020, 3:14am UTC](https://devforum.zoom.us/t/screenshare-ui-api-called-on-a-background-thread/23748 "2020-07-10T03:14:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pandiyaraj](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/pandiyaraj/32/7093_2.png) [@pandiyaraj](https://devforum.zoom.us/u/pandiyaraj)\
**Post date:** [July 10, 2020, 3:14am UTC](https://devforum.zoom.us/t/screenshare-ui-api-called-on-a-background-thread/23748/1 "2020-07-10T03:14:21Z")

</div>

**Description**  
Hi Team,

I was able to start the meeting and screen share using Zoom iOS SDK. After starting the screen I am getting ‘UI API called on a background thread’ error. Also, participants are getting screen after 10 to 30 seconds.

Even though I am calling share method in Main Queue.

Code Snippet:

DispatchQueue.main.async {  
if let ms = MobileRTC.shared().getMeetingService(){  
ms.startAppShare()  
ms.appShare(withView: self.view)  
}  
}

Error:

# ================================================================= Main Thread Checker: UI API called on a background thread: -[UIView frame] PID: 1765, TID: 634506, Thread name: (none), Queue name: us.zoom.timerqueue, QoS: 0 Backtrace: 4 MobileRTC 0x00000001049cdacc \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14942792 5 MobileRTC 0x00000001049ccea4 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14939680 6 MobileRTC 0x00000001049cd0f4 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14940272 7 MobileRTC 0x00000001049cd7e0 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14942044 8 libdispatch.dylib 0x000000010575f27c \_dispatch\_client\_callout + 20 9 libdispatch.dylib 0x0000000105762058 \_dispatch\_continuation\_pop + 572 10 libdispatch.dylib 0x0000000105775824 \_dispatch\_source\_invoke2 + 984 11 libdispatch.dylib 0x0000000105775114 \_dispatch\_source\_invoke + 468 12 libdispatch.dylib 0x0000000105766740 \_dispatch\_lane\_serial\_drain + 260 13 libdispatch.dylib 0x00000001057674fc \_dispatch\_lane\_invoke + 408 14 libdispatch.dylib 0x00000001057724dc \_dispatch\_workloop\_worker\_thread + 1344 15 libsystem\_pthread.dylib 0x000000018b625a94 \_pthread\_wqthread + 280 16 libsystem\_pthread.dylib 0x000000018b62bc7c start\_wqthread + 8 2020-07-10 08:28:19.159493+0530 Power 20[1765:634506] [reports] Main Thread Checker: UI API called on a background thread: -[UIView frame] PID: 1765, TID: 634506, Thread name: (none), Queue name: us.zoom.timerqueue, QoS: 0 Backtrace: 4 MobileRTC 0x00000001049cdacc \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14942792 5 MobileRTC 0x00000001049ccea4 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14939680 6 MobileRTC 0x00000001049cd0f4 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14940272 7 MobileRTC 0x00000001049cd7e0 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14942044 8 libdispatch.dylib 0x000000010575f27c \_dispatch\_client\_callout + 20 9 libdispatch.dylib 0x0000000105762058 \_dispatch\_continuation\_pop + 572 10 libdispatch.dylib 0x0000000105775824 \_dispatch\_source\_invoke2 + 984 11 libdispatch.dylib 0x0000000105775114 \_dispatch\_source\_invoke + 468 12 libdispatch.dylib 0x0000000105766740 \_dispatch\_lane\_serial\_drain + 260 13 libdispatch.dylib 0x00000001057674fc \_dispatch\_lane\_invoke + 408 14 libdispatch.dylib 0x00000001057724dc \_dispatch\_workloop\_worker\_thread + 1344 15 libsystem\_pthread.dylib 0x000000018b625a94 \_pthread\_wqthread + 280 16 libsystem\_pthread.dylib 0x000000018b62bc7c start\_wqthread + 8

# Main Thread Checker: UI API called on a background thread: -[UIView contentScaleFactor] PID: 1765, TID: 634506, Thread name: (none), Queue name: us.zoom.timerqueue, QoS: 0 Backtrace: 4 MobileRTC 0x00000001049ce270 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14944748 5 MobileRTC 0x00000001049cd094 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14940176 6 MobileRTC 0x00000001049cd1dc \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14940504 7 MobileRTC 0x00000001049cd7e0 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14942044 8 libdispatch.dylib 0x000000010575f27c \_dispatch\_client\_callout + 20 9 libdispatch.dylib 0x0000000105762058 \_dispatch\_continuation\_pop + 572 10 libdispatch.dylib 0x0000000105775824 \_dispatch\_source\_invoke2 + 984 11 libdispatch.dylib 0x0000000105775114 \_dispatch\_source\_invoke + 468 12 libdispatch.dylib 0x0000000105766740 \_dispatch\_lane\_serial\_drain + 260 13 libdispatch.dylib 0x00000001057674fc \_dispatch\_lane\_invoke + 408 14 libdispatch.dylib 0x00000001057724dc \_dispatch\_workloop\_worker\_thread + 1344 15 libsystem\_pthread.dylib 0x000000018b625a94 \_pthread\_wqthread + 280 16 libsystem\_pthread.dylib 0x000000018b62bc7c start\_wqthread + 8 2020-07-10 08:28:35.637867+0530 Power 20[1765:634506] [reports] Main Thread Checker: UI API called on a background thread: -[UIView contentScaleFactor] PID: 1765, TID: 634506, Thread name: (none), Queue name: us.zoom.timerqueue, QoS: 0 Backtrace: 4 MobileRTC 0x00000001049ce270 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14944748 5 MobileRTC 0x00000001049cd094 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14940176 6 MobileRTC 0x00000001049cd1dc \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14940504 7 MobileRTC 0x00000001049cd7e0 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14942044 8 libdispatch.dylib 0x000000010575f27c \_dispatch\_client\_callout + 20 9 libdispatch.dylib 0x0000000105762058 \_dispatch\_continuation\_pop + 572 10 libdispatch.dylib 0x0000000105775824 \_dispatch\_source\_invoke2 + 984 11 libdispatch.dylib 0x0000000105775114 \_dispatch\_source\_invoke + 468 12 libdispatch.dylib 0x0000000105766740 \_dispatch\_lane\_serial\_drain + 260 13 libdispatch.dylib 0x00000001057674fc \_dispatch\_lane\_invoke + 408 14 libdispatch.dylib 0x00000001057724dc \_dispatch\_workloop\_worker\_thread + 1344 15 libsystem\_pthread.dylib 0x000000018b625a94 \_pthread\_wqthread + 280 16 libsystem\_pthread.dylib 0x000000018b62bc7c start\_wqthread + 8

# Main Thread Checker: UI API called on a background thread: -[UIView layer] PID: 1765, TID: 634506, Thread name: (none), Queue name: us.zoom.timerqueue, QoS: 0 Backtrace: 4 MobileRTC 0x00000001049ce284 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14944768 5 MobileRTC 0x00000001049cd094 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14940176 6 MobileRTC 0x00000001049cd1dc \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14940504 7 MobileRTC 0x00000001049cd7e0 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14942044 8 libdispatch.dylib 0x000000010575f27c \_dispatch\_client\_callout + 20 9 libdispatch.dylib 0x0000000105762058 \_dispatch\_continuation\_pop + 572 10 libdispatch.dylib 0x0000000105775824 \_dispatch\_source\_invoke2 + 984 11 libdispatch.dylib 0x0000000105775114 \_dispatch\_source\_invoke + 468 12 libdispatch.dylib 0x0000000105766740 \_dispatch\_lane\_serial\_drain + 260 13 libdispatch.dylib 0x00000001057674fc \_dispatch\_lane\_invoke + 408 14 libdispatch.dylib 0x00000001057724dc \_dispatch\_workloop\_worker\_thread + 1344 15 libsystem\_pthread.dylib 0x000000018b625a94 \_pthread\_wqthread + 280 16 libsystem\_pthread.dylib 0x000000018b62bc7c start\_wqthread + 8 2020-07-10 08:28:35.769481+0530 Power 20[1765:634506] [reports] Main Thread Checker: UI API called on a background thread: -[UIView layer] PID: 1765, TID: 634506, Thread name: (none), Queue name: us.zoom.timerqueue, QoS: 0 Backtrace: 4 MobileRTC 0x00000001049ce284 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14944768 5 MobileRTC 0x00000001049cd094 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14940176 6 MobileRTC 0x00000001049cd1dc \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14940504 7 MobileRTC 0x00000001049cd7e0 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14942044 8 libdispatch.dylib 0x000000010575f27c \_dispatch\_client\_callout + 20 9 libdispatch.dylib 0x0000000105762058 \_dispatch\_continuation\_pop + 572 10 libdispatch.dylib 0x0000000105775824 \_dispatch\_source\_invoke2 + 984 11 libdispatch.dylib 0x0000000105775114 \_dispatch\_source\_invoke + 468 12 libdispatch.dylib 0x0000000105766740 \_dispatch\_lane\_serial\_drain + 260 13 libdispatch.dylib 0x00000001057674fc \_dispatch\_lane\_invoke + 408 14 libdispatch.dylib 0x00000001057724dc \_dispatch\_workloop\_worker\_thread + 1344 15 libsystem\_pthread.dylib 0x000000018b625a94 \_pthread\_wqthread + 280 16 libsystem\_pthread.dylib 0x000000018b62bc7c start\_wqthread + 8

# Main Thread Checker: UI API called on a background thread: -[UIView setContentScaleFactor:] PID: 1765, TID: 634506, Thread name: (none), Queue name: us.zoom.timerqueue, QoS: 0 Backtrace: 4 MobileRTC 0x00000001049ce2a8 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14944804 5 MobileRTC 0x00000001049cd094 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14940176 6 MobileRTC 0x00000001049cd1dc \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14940504 7 MobileRTC 0x00000001049cd7e0 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14942044 8 libdispatch.dylib 0x000000010575f27c \_dispatch\_client\_callout + 20 9 libdispatch.dylib 0x0000000105762058 \_dispatch\_continuation\_pop + 572 10 libdispatch.dylib 0x0000000105775824 \_dispatch\_source\_invoke2 + 984 11 libdispatch.dylib 0x0000000105775114 \_dispatch\_source\_invoke + 468 12 libdispatch.dylib 0x0000000105766740 \_dispatch\_lane\_serial\_drain + 260 13 libdispatch.dylib 0x00000001057674fc \_dispatch\_lane\_invoke + 408 14 libdispatch.dylib 0x00000001057724dc \_dispatch\_workloop\_worker\_thread + 1344 15 libsystem\_pthread.dylib 0x000000018b625a94 \_pthread\_wqthread + 280 16 libsystem\_pthread.dylib 0x000000018b62bc7c start\_wqthread + 8 2020-07-10 08:28:35.889817+0530 Power 20[1765:634506] [reports] Main Thread Checker: UI API called on a background thread: -[UIView setContentScaleFactor:] PID: 1765, TID: 634506, Thread name: (none), Queue name: us.zoom.timerqueue, QoS: 0 Backtrace: 4 MobileRTC 0x00000001049ce2a8 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14944804 5 MobileRTC 0x00000001049cd094 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14940176 6 MobileRTC 0x00000001049cd1dc \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14940504 7 MobileRTC 0x00000001049cd7e0 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14942044 8 libdispatch.dylib 0x000000010575f27c \_dispatch\_client\_callout + 20 9 libdispatch.dylib 0x0000000105762058 \_dispatch\_continuation\_pop + 572 10 libdispatch.dylib 0x0000000105775824 \_dispatch\_source\_invoke2 + 984 11 libdispatch.dylib 0x0000000105775114 \_dispatch\_source\_invoke + 468 12 libdispatch.dylib 0x0000000105766740 \_dispatch\_lane\_serial\_drain + 260 13 libdispatch.dylib 0x00000001057674fc \_dispatch\_lane\_invoke + 408 14 libdispatch.dylib 0x00000001057724dc \_dispatch\_workloop\_worker\_thread + 1344 15 libsystem\_pthread.dylib 0x000000018b625a94 \_pthread\_wqthread + 280 16 libsystem\_pthread.dylib 0x000000018b62bc7c start\_wqthread + 8

# Main Thread Checker: UI API called on a background thread: -[UIView bounds] PID: 1765, TID: 634506, Thread name: (none), Queue name: us.zoom.timerqueue, QoS: 0 Backtrace: 4 MobileRTC 0x00000001049ce3e4 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14945120 5 MobileRTC 0x00000001049cd094 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14940176 6 MobileRTC 0x00000001049cd1dc \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14940504 7 MobileRTC 0x00000001049cd7e0 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14942044 8 libdispatch.dylib 0x000000010575f27c \_dispatch\_client\_callout + 20 9 libdispatch.dylib 0x0000000105762058 \_dispatch\_continuation\_pop + 572 10 libdispatch.dylib 0x0000000105775824 \_dispatch\_source\_invoke2 + 984 11 libdispatch.dylib 0x0000000105775114 \_dispatch\_source\_invoke + 468 12 libdispatch.dylib 0x0000000105766740 \_dispatch\_lane\_serial\_drain + 260 13 libdispatch.dylib 0x00000001057674fc \_dispatch\_lane\_invoke + 408 14 libdispatch.dylib 0x00000001057724dc \_dispatch\_workloop\_worker\_thread + 1344 15 libsystem\_pthread.dylib 0x000000018b625a94 \_pthread\_wqthread + 280 16 libsystem\_pthread.dylib 0x000000018b62bc7c start\_wqthread + 8 2020-07-10 08:28:35.984150+0530 Power 20[1765:634506] [reports] Main Thread Checker: UI API called on a background thread: -[UIView bounds] PID: 1765, TID: 634506, Thread name: (none), Queue name: us.zoom.timerqueue, QoS: 0 Backtrace: 4 MobileRTC 0x00000001049ce3e4 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14945120 5 MobileRTC 0x00000001049cd094 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14940176 6 MobileRTC 0x00000001049cd1dc \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14940504 7 MobileRTC 0x00000001049cd7e0 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14942044 8 libdispatch.dylib 0x000000010575f27c \_dispatch\_client\_callout + 20 9 libdispatch.dylib 0x0000000105762058 \_dispatch\_continuation\_pop + 572 10 libdispatch.dylib 0x0000000105775824 \_dispatch\_source\_invoke2 + 984 11 libdispatch.dylib 0x0000000105775114 \_dispatch\_source\_invoke + 468 12 libdispatch.dylib 0x0000000105766740 \_dispatch\_lane\_serial\_drain + 260 13 libdispatch.dylib 0x00000001057674fc \_dispatch\_lane\_invoke + 408 14 libdispatch.dylib 0x00000001057724dc \_dispatch\_workloop\_worker\_thread + 1344 15 libsystem\_pthread.dylib 0x000000018b625a94 \_pthread\_wqthread + 280 16 libsystem\_pthread.dylib 0x000000018b62bc7c start\_wqthread + 8

Main Thread Checker: UI API called on a background thread: -[UIView drawViewHierarchyInRect:afterScreenUpdates:]  
PID: 1765, TID: 634506, Thread name: (none), Queue name: us.zoom.timerqueue, QoS: 0  
Backtrace:  
4 MobileRTC 0x00000001049ce3f8 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14945140  
5 MobileRTC 0x00000001049cd094 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14940176  
6 MobileRTC 0x00000001049cd1dc \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14940504  
7 MobileRTC 0x00000001049cd7e0 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14942044  
8 libdispatch.dylib 0x000000010575f27c \_dispatch\_client\_callout + 20  
9 libdispatch.dylib 0x0000000105762058 \_dispatch\_continuation\_pop + 572  
10 libdispatch.dylib 0x0000000105775824 \_dispatch\_source\_invoke2 + 984  
11 libdispatch.dylib 0x0000000105775114 \_dispatch\_source\_invoke + 468  
12 libdispatch.dylib 0x0000000105766740 \_dispatch\_lane\_serial\_drain + 260  
13 libdispatch.dylib 0x00000001057674fc \_dispatch\_lane\_invoke + 408  
14 libdispatch.dylib 0x00000001057724dc \_dispatch\_workloop\_worker\_thread + 1344  
15 libsystem\_pthread.dylib 0x000000018b625a94 \_pthread\_wqthread + 280  
16 libsystem\_pthread.dylib 0x000000018b62bc7c start\_wqthread + 8  
2020-07-10 08:28:36.085066+0530 Power 20[1765:634506] [reports] Main Thread Checker: UI API called on a background thread: -[UIView drawViewHierarchyInRect:afterScreenUpdates:]  
PID: 1765, TID: 634506, Thread name: (none), Queue name: us.zoom.timerqueue, QoS: 0  
Backtrace:  
4 MobileRTC 0x00000001049ce3f8 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14945140  
5 MobileRTC 0x00000001049cd094 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14940176  
6 MobileRTC 0x00000001049cd1dc \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14940504  
7 MobileRTC 0x00000001049cd7e0 \_Z16TermSBPTUIModulePN3Cmm22ICmmMessageQueueClientE + 14942044  
8 libdispatch.dylib 0x000000010575f27c \_dispatch\_client\_callout + 20  
9 libdispatch.dylib 0x0000000105762058 \_dispatch\_continuation\_pop + 572  
10 libdispatch.dylib 0x0000000105775824 \_dispatch\_source\_invoke2 + 984  
11 libdispatch.dylib 0x0000000105775114 \_dispatch\_source\_invoke + 468  
12 libdispatch.dylib 0x0000000105766740 \_dispatch\_lane\_serial\_drain + 260  
13 libdispatch.dylib 0x00000001057674fc \_dispatch\_lane\_invoke + 408  
14 libdispatch.dylib 0x00000001057724dc \_dispatch\_workloop\_worker\_thread + 1344  
15 libsystem\_pthread.dylib 0x000000018b625a94 \_pthread\_wqthread + 280  
16 libsystem\_pthread.dylib 0x000000018b62bc7c start\_wqthread + 8

**Which version?**  
v5.0.24433.0616

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [July 10, 2020, 10:50pm UTC](https://devforum.zoom.us/t/screenshare-ui-api-called-on-a-background-thread/23748/2 "2020-07-10T22:50:31Z")

</div>

Hi @pandiyaraj,

Thanks for the post and the info. Is this reproducible with our demo app? I tried to follow the steps you are mentioning and I did not encounter such issue. Could you also provide the SDK log for us to further investigate?

Thanks!

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [July 14, 2020, 1:54am UTC](https://devforum.zoom.us/t/screenshare-ui-api-called-on-a-background-thread/23748/3 "2020-07-14T01:54:39Z")

</div>

Hi @pandiyaraj

> [@pandiyaraj](#):
>
> UI API called on a background thread

Our SDK has the main thread checker when sharing a view. Please uncheck the main thread checker in Xcode \> Product \> Scheme \> Edit Scheme \> Run \> Diagnostics \> Runtime API Checking \> Main Thread Checker to avoid this issue.

Thanks!

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 10:40pm UTC](https://devforum.zoom.us/t/screenshare-ui-api-called-on-a-background-thread/23748/4 "2020-08-21T22:40:58Z")

</div>

Closed on August 21, 2020, 10:40pm UTC


