Swift – IBOutletCollection equivalent

Update: This works properly in Xcode now – “Outlet Collection” is one of the connection options in Interface Builder, which creates something that looks like: @IBOutlet var labelCollection: [UILabel]! While we’re waiting for a fix, you can approximate this using a computed property. Let’s say my view has five UILabels that I want in a … Read more

How can I use IBOutletCollection to connect multiple UIImageViews to the same outlet?

Declare a property to hold your imageView’s and then hook them up in interface builder like normal @property (nonatomic, strong) IBOutletCollection(UIImageView) NSArray *imageViews; it’s just a normal NSArray but when the nib is loaded it will be populated with your imageView’s Update In the header file for you view controller which has the multiple imageView’s … Read more