Posts

Post not yet marked as solved
58 Replies
j.santos.f's reply pointed me to the right direction. Thanks for that.In my case, the build hangs on my own project, not on a Carthage/Cocoapods dependency. While it is a compiler bug for the compiler to hang, it might still be a bug in your code that causes this (like in mine).The compiler bug that was fixed is this one: https://bugs.swift.org/browse/SR-11010Going from the example in the bug report, I checked the places where I was using a while loop. Turns out I have a similar while loop that was looking up super views.var cell = self.superview while !(cell is UITableViewCell) { cell = cell?.superview } return cell as? UITableViewCellThewhile loop will go forever if `cell` is nil. So the fix is:var cell = self.superview while cell != nil && !(cell is UITableViewCell) { cell = cell?.superview } return cell as? UITableViewCellWith this code change, archiving works with the Optimized for Speed (-O) option.Hopefully this could help you if you have something similar, or at least point you to the right direction.