Hey guys, I am doing the App Development with Swift book and have reached the "Apple Pie" project. Everything was going fine until the very last function "enableLetterButtons(_ enable: Bool)" when I try to run the app with this code I get only a white screen in Simulator and the above error "NSArray element failed to match the Swift Array element type" in Xcode. Am I missing something here? Really appreciate any help.
>> "NSArray element failed to match the Swift Array element type"
Because your outlet ("letterButtons") really lives in the Obj-C world, it's actually a NSArray, wrapped in a Swift Array value. (This transforms its apparent behavior from a reference type to a value type, but this not relevant to the issue here.)
So, the problem is that you've connected one or more objects to the "letterButtons" outlet that isn't actully a UIButton. I would suggest you try disconnecting everything from that outlet, then connect only the UIButtons you really want it to refer to.