How to loop through Outlets of a UIViewController with Swift
问题 I'm wondering, if it's possible to loop through all outlets of a UIViewController with swift. Specificly, I want to check if every textfield is filled by the user. 回答1: This is what Outlet Collections are for. Drag all your textfields in the same Outlet Collection in InterfaceBuilder and create an @IBOutlet to that collection in your class file: To create the outlet collection in InterfaceBuilder, ctrl-drag from the first UITextField to your class file in the assistant editor. Then choose