Application Tool Kit

UI API called from background thread Group

Hi, 

there is a problem with you ATK Library for iOS (SingleLineWidget). I have successfully implemented this class in Swift, however during runtime I get errors that UILabel font and frame are changing on background thread. 

I'm testing it on both simulator and physical device. The problem is connected with both my implementation of ATK and also with your Sample Project.

1. runtime: UI API called from background thread: -[UILabel font] must be used from main thread only

2. runtime: UI API called from background thread: -[UILabel setFont:] must be used from main thread only

3. runtime: UI API called from background thread: -[UIScrollView contentInset] must be used from main thread only

4. runtime: UI API called from background thread: -[UILabel setFrame:] must be used from main thread only


Main Thread Checker: UI API called on a background thread: -[UILabel setFrame:]
PID: 24312, TID: 779733, Thread name: (none), Queue name: com.apple.root.default-qos.overcommit, QoS: 21
Backtrace:
4   myAppName                               0x00000001030cf64b -[SLTWSingleLineWidget onTypeset:] + 1714
5   myAppName                               0x00000001030e1734 _ZN3atk4sltw27SingleLineControllerPrivate13notifyTypesetERNS_4text11TypesetInfoE + 62
6   myAppName                               0x00000001030e355e _ZN3atk4sltw27SingleLineControllerPrivate16typesetAndInsertEiRKNSt3__112basic_stringIDsNS2_11char_traitsIDsEENS2_9allocatorIDsEEEEb + 852
7   myAppName                               0x00000001030e99d7 _ZNSt3__110__function6__funcIZN3atk4sltw27SingleLineControllerPrivate7setTextERKNS_12basic_stringIDsNS_11char_traitsIDsEENS_9allocatorIDsEEEEE4$_15NS8_ISD_EEFvvEEclEv + 407
8   myAppName                               0x00000001030f32d4 _ZN3atk4core9Scheduler7executeIN8myscript8document4PageEEEvNSt3__110shared_ptrINS6_8functionIFvvEEEEERKT_ + 58
9   myAppName                               0x00000001030f3012 _ZN3atk4core9Scheduler3runIN8myscript8document4PageEEEvRKT_ + 386
10  myAppName                               0x00000001030f2e00 _ZNSt3__114__thread_proxyINS_5tupleIJZN3atk4core9SchedulerC1ENS3_4PageEEUlvE_EEEEEPvS8_ + 68
11  libsystem_pthread.dylib             0x0000000109ae893b _pthread_body + 180
12  libsystem_pthread.dylib             0x0000000109ae8887 _pthread_body + 0
13  libsystem_pthread.dylib             0x0000000109ae808d thread_start + 13
2018-01-18 23:04:01.411100+0100 myAppName[24312:779733] [reports] Main Thread Checker: UI API called on a background thread: -[UILabel setFrame:]
PID: 24312, TID: 779733, Thread name: (none), Queue name: com.apple.root.default-qos.overcommit, QoS: 21
Backtrace:
4   myAppName                               0x00000001030cf64b -[SLTWSingleLineWidget onTypeset:] + 1714
5   myAppName                               0x00000001030e1734 _ZN3atk4sltw27SingleLineControllerPrivate13notifyTypesetERNS_4text11TypesetInfoE + 62
6   myAppName                               0x00000001030e355e _ZN3atk4sltw27SingleLineControllerPrivate16typesetAndInsertEiRKNSt3__112basic_stringIDsNS2_11char_traitsIDsEENS2_9allocatorIDsEEEEb + 852
7   myAppName                               0x00000001030e99d7 _ZNSt3__110__function6__funcIZN3atk4sltw27SingleLineControllerPrivate7setTextERKNS_12basic_stringIDsNS_11char_traitsIDsEENS_9allocatorIDsEEEEE4$_15NS8_ISD_EEFvvEEclEv + 407
8   myAppName                               0x00000001030f32d4 _ZN3atk4core9Scheduler7executeIN8myscript8document4PageEEEvNSt3__110shared_ptrINS6_8functionIFvvEEEEERKT_ + 58
9   myAppName                               0x00000001030f3012 _ZN3atk4core9Scheduler3runIN8myscript8document4PageEEEvRKT_ + 386
10  myAppName                               0x00000001030f2e00 _ZNSt3__114__thread_proxyINS_5tupleIJZN3atk4core9SchedulerC1ENS3_4PageEEUlvE_EEEEEPvS8_ + 68
11  libsystem_pthread.dylib             0x0000000109ae893b _pthread_body + 180
12  libsystem_pthread.dylib             0x0000000109ae8887 _pthread_body + 0

13  libsystem_pthread.dylib             0x0000000109ae808d thread_start + 13


Platform: iOS 11.0 and 11.2

Language: Swift




1 person has this question
1 Comment

Dear Jakub,

thank you for contacting us.

Currently, this is a known issue when using ATK with swift.

We do not plan to update the ATK, as it is rather old and it is o be replaced by th iink SDK.

Best regards,

Olivier
Login or Signup to post a comment