forEach not working in Swift for UIKit

I am trying to debug the reason why the Custom Fonts entitlement is not working in my Fire project. I tried to use the standard approach for dumping the installed fonts:

UIFont.familyNames.forEach({ familyName in
            print(familyName)
})

Remember Elements targets Cocoa/Objective-C, not Swift ABI. UIFont.familyNames is (probably) an NSArray, not whatever abomination Apple Swift mangles it into — and forEach is not an API on NSArray.

for familyname in UIFont.familyNames {
            print(familyName)
}

should work fine.

Marc, I don’t think I will ever stop mixing that bit up! :see_no_evil:

1 Like

no worries. :wink: