Steve Kuo Steve Kuo - 1 year ago 124
Swift Question

Xcode hangs on "Compiling Swift source files"

I'm running Xcode 7.3.1. When building my Swift based project, it hangs on "Compiling Swift source files". I've tried various combination of deleted

, clean, run, restarting Xcode, restarting OS X, none seem to work. Any ideas?

Answer Source

Thanks for all commentors' suggestions. I narrowed it down to a map's closure referencing a property that I had removed. Example:

var people: [Person] = ...
let foo = { "\($, \($0.age)" }

where Person looks something like:

protocol Person {
    var name: String { get }
    var age: Int { get }

This all works fine. Then I removed age while keeping the closure unchanged. This caused Xcode to become hopelessly confused. Probably related to the Swift's type inference.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download