Swift put multiple IBOutlets in an Array

you can define a generic outlet collection in Swift like this:

@IBOutlet var collectionOfViews: Array<UIView>? // = [UIView]?

or for e.g. UIButton objects:

@IBOutlet var collectionOfButtons: Array<UIButton>? // = [UIButton]?

you can find your collections under the Outlet Collections group as usually are in the File’s Owner:

Outlet Collections

it would look on my console after connecting 5 random buttons:

Connected UIButton instances to Collection

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)