Search code examples
iosobjective-cswiftxcodestoryboard

iOS: Creating many IBOutlets has performance overhead?


If we create many IBOutlets from the storyboard/xib to the ViewController/View then will it cause performance overhead? If so how?


Solution

  • See the IBOutlet Definition in Apple Developer.

    Here's Outlets documentation link

    We can see this

    the more outlets an object has, the more memory it takes up. 
    If there are other ways to obtain a reference to an object, 
    such as finding it through its index position in a matrix, 
    or through its inclusion as a function parameter, 
    or through use of a tag (an assigned numeric identifier), 
    you should do that instead.
    

    So it will cause performance overhead.

    For more details, you can see the documents.