drasick
drasick

Reputation: 290

Why use ivars for IBOutlets instead of properties?

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:

Thanks

Upvotes: 0

Views: 39

Answers (1)

Cy-4AH
Cy-4AH

Reputation: 4585

The key word here is legacy

  • No advantages
  • All variables (ivars and not) by default is strong.

Upvotes: 3

Related Questions