I just started to work on a new project. It has a lot of legacy code and I found the following code
@interface WLLeftSideViewController : UIViewController {
@private
__weak IBOutlet UIButton *_signInButton;
__weak IBOutlet UIButton *_signOutButton;
__weak IBOutlet UILabel *_nameLabel;
__weak IBOutlet UILabel *_emailLabel;
__weak IBOutlet WLLeftSideMenuView *_tableView;
__weak IBOutlet UIButton *_settingsButton;
__weak IBOutlet NSLayoutConstraint *_heightConstraint;
}
I have a couple of doubts:
- What could be the advantage of using private ivars for an IBOutlet?
- Why add the __weak? As I understand in ARC environment ivars are always weak.
Thanks