One IBOutlet for two UILabels

I have two views in one .xib (one view for landscape, the other for portrait). How can I use the same IBOutlet that I defined in the @interface section for both labels if they have the same functionality. (ctrl + dragging into both of them does not help - every time I drag onto the second, the first loses its outlet).

+3
source share
2 answers

You can not. IBOutlet is an object (UILabel?), Which should store a link to a user interface element. Naturally, a single object cannot refer to two different objects.

0
source

, , , IBOutletCollection IBOutlet.

IBOutletCollection(UILabel) NSArray *labels;

.

0

Source: https://habr.com/ru/post/1739321/