I have a blue line in my app that displays an artificial horizon. I want to be able to display and remove it at different parts of the code (.m). Can I declare it (lineViewHorizon) universally.
At present I can make it appear/disappear only within the same section/method of code.
I presume this can be done?
UIView *lineViewHorizon = [[UIView alloc] initWithFrame:CGRectMake(0, pageTopMargin+inthorizon, self.view.bounds.size.width, 2)];
lineViewHorizon.backgroundColor = [UIColor blueColor];
[self.view addSubview:lineViewHorizon];
[lineViewHorizon removeFromSuperview];