Skip to content

Conversation

@lacyrhoades
Copy link

Otherwise, reading any UIKit values like .bounds will give a warning:
Main Thread Checker: UI API called on a background thread: -[UIView bounds]


runOnMainQueueWithoutDeadlocking(^{
currentBounds = self.bounds;
});
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this by logging:

NSLog(@"Is main thread: %@", [NSThread isMainThread] ? @"YES" : @"NO");

Usually is "yes" but not always.

Otherwise, reading any UIKit values like `.bounds` will give a warning:
Main Thread Checker: UI API called on a background thread: -[UIView bounds]

Taking out debug code
@lacyrhoades lacyrhoades force-pushed the xcode-9-main-thread-checker-fix branch from 401b098 to ae1ed97 Compare November 25, 2017 20:48
@ntnmrndn
Copy link

This causes deadlock for me in layoutSubviews

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 this pull request may close these issues.

3 participants