After searching Google for this confusion, I found out that the best place to post an IBOutlet is:
@interface GallantViewController : UIViewController @property (nonatomic, weak) IBOutlet UISwitch *switch; @end
but from what I'm saying, now the switch variable is visible outside of the GallantViewController . Isn't that weird? I thought this wrong method:
@interface GoofusViewController : UIViewController { IBOutlet UISwitch *_switch } @end
behaved this way, and his movement would fix it. Why do you want to manipulate a button, for example, from another class, instead of implementing it logically only in the GallantViewController ?
source share