Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main Thread Checker: UI API called on a background thread: -[UIView bounds] #64

Closed
MarcoFilosi opened this issue Oct 4, 2017 · 0 comments · Fixed by #67
Closed

Main Thread Checker: UI API called on a background thread: -[UIView bounds] #64

MarcoFilosi opened this issue Oct 4, 2017 · 0 comments · Fixed by #67

Comments

@MarcoFilosi
Copy link
Contributor

MarcoFilosi commented Oct 4, 2017

Xcode 9 adds a new main thread checker. I was running our app through the main thread checker to see where we may be accessing properties or invoking methods from background threads and discovered that bounds in TiledView.swift line 62 is not called from main thread.

Version Info

  • PDFReader version: 2.4.0
  • iOS version: 11.0

Expected Behavior

Access -[UIView bounds] from main thread

Actual Behavior

Access -[UIView bounds] from com.apple.root.default-qos dispatch queue.

Steps to Reproduce

  1. Install XCode 9
  2. Run a project that instantiates and push a PDFReaderViewController
  3. Wait until view controller has been initialized. In Logs you could find message error from Main Thread Checker

Logs

Main Thread Checker: UI API called on a background thread: -[UIView bounds]
PID: 5094, TID: 1329417, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 21
Backtrace:
4   PDFReader                           0x0000000103564bf3 _T09PDFReader9TiledViewC4drawySo7CALayerC_So9CGContextC2intF + 291
5   PDFReader                           0x000000010356543d _T09PDFReader9TiledViewC4drawySo7CALayerC_So9CGContextC2intFTo + 77
6   QuartzCore                          0x000000010ea5c0f8 -[CALayer drawInContext:] + 267
7   QuartzCore                          0x000000010e9a8476 _ZL18tiled_layer_renderP16_CAImageProviderjjjjPv + 1817
8   QuartzCore                          0x000000010ea325ae _ZL21CAImageProviderThreadPjb + 789
9   libdispatch.dylib                   0x0000000109dcf43c _dispatch_client_callout + 8
10  libdispatch.dylib                   0x0000000109dd4352 _dispatch_queue_override_invoke + 1458
11  libdispatch.dylib                   0x0000000109ddb1f9 _dispatch_root_queue_drain + 772
12  libdispatch.dylib                   0x0000000109ddae97 _dispatch_worker_thread3 + 132
13  libsystem_pthread.dylib             0x000000010a2925a2 _pthread_wqthread + 1299
14  libsystem_pthread.dylib             0x000000010a29207d start_wqthread + 13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant