Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]

It’s hard to find the UI code which is not executed in main thread sometimes. You can use the trick below to locate it and fix it. Choose Edit Scheme -> Diagnostics, tick Main Thread Checker. Xcode 11.4.1 Click the small arrow next to the Main Thread Checker to create a Main Thread Checker breakpoint. … Read more

iOS 11 iPhone X simulator UITabBar icons and titles being rendered on top covering eachother

I was able to get around the problem by simply calling invalidateIntrinsicContentSize on the UITabBar in viewDidLayoutSubviews. -(void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; [self.tabBar invalidateIntrinsicContentSize]; } Note: The bottom of the tab bar will need to be contained to the bottom of the main view, rather than the safe area, and the tab bar should have no … Read more

Xcode 9 – “Fixed Width Constraints May Cause Clipping” and Other Localization Warnings

I was getting the same warnings even without multiple languages in my app, which led me to find out what was really going on. . . There are a few different things going on here. I was able to silence the fixed-width warnings in my own app by changing the width of the object spacings … Read more

The use of Swift 3 @objc inference in Swift 4 mode is deprecated?

I got rid of this warning by changing the “Swift 3 @objc Inference” build setting of my targets to “Default”. From this article: Before Swift 4, the compiler made some Swift declarations automatically available to Objective-C. For example, if one subclassed from NSObject, the compiler created Objective-C entry points for all methods in such classes. … Read more