Sitemap
iOS Essentials

Welcome to iOS Essentials, your ultimate resource for mastering iOS development. Whether you’re a seasoned developer or just starting out, our publication provides valuable insights, tips, and tutorials to help you excel in creating exceptional iOS applications.

Member-only story

What is an IBOutletCollection in iOS??

3 min readAug 23, 2017

--

As the name says, an IBOutletCollection is a collection of IBOutlets. It can either be a collection of UI elements.

An IBOutletCollection of UIButton in code will look like this :

@IBOutlet var starButtons: [UIButton]!

It will be an array of UIButton objects.

There are two rather curious things to note about an IBOutletCollection array:

  • Its order is not necessarily guaranteed. The order of an outlet collection appears to be roughly the order in which their connections are established in Interface Builder. However, there are numerous reports of that order changing across versions of Xcode, or as a natural consequence of version control. Nonetheless, having code rely on a fixed order is strongly discouraged.
  • No matter what type is declared for the property, an IBOutletCollection is always an NSArray

--

--

iOS Essentials
iOS Essentials

Published in iOS Essentials

Welcome to iOS Essentials, your ultimate resource for mastering iOS development. Whether you’re a seasoned developer or just starting out, our publication provides valuable insights, tips, and tutorials to help you excel in creating exceptional iOS applications.

Abhimuralidharan
Abhimuralidharan

Written by Abhimuralidharan

iOS and tvOS developer, dreamer, photographer 🤨

Responses (14)