How can I use the legacy build system with Xcode 10’s `xcodebuild`?

There is an (as of yet undocumented) flag in xcodebuild: -UseModernBuildSystem=<value>. The value can be either 0 or NO to use the legacy (“original”) build system, or 1 or YES to use the new build system. For example: xcodebuild -workspace Foo.xcworkspace -scheme Bar -configuration Release -archivePath /path/to/Foo.xcarchive clean archive -UseModernBuildSystem=NO (-UseNewBuildSystem=<value> seems to work as … Read more

In iOS 12, when does the UICollectionView layout cells, use autolayout in nib

For all solutions, note that there is no need to explicitly call reloadData in viewDidLoad: it will happen automatically. Solution 1 Inspired by Samantha idea: invalidateLayout asynchronously in viewDidLoad. override func viewDidLoad() { super.viewDidLoad() //[…] for _ in 0 ..< 1000 { array.append(randomKeyByBitLength(Int(arc4random_uniform(8)))!) } DispatchQueue.main.async { self.collectionView.collectionViewLayout.invalidateLayout() } } Solution 2 (imperfect, see DHennessy13 improvement … Read more

preferredStatusBarStyle var not working in iOS12?

This has nothing to do with iOS 12. You just have the rules wrong. In a navigation controller situation, the color of the status bar is not determined by the view controller’s preferredStatusBarStyle. It is determined, amazingly, by the navigation bar’s barStyle. To get light status bar text, say (in your view controller): self.navigationController?.navigationBar.barStyle = … Read more

ld: library not found for -lstdc++.6

You’ll have this issue when targeting iOS App. It’s stated in the Release note: Deprecation Notices: Building with libstdc++ was deprecated with Xcode 8 and is not supported in Xcode 10 when targeting iOS. C++ projects must now migrate to libc++ and are recommended to set a deployment target of iOS 7 or later. Besides … Read more