Я хотел бы создать UIView
, который я хочу скрыть в nib-файле UIViewController
, а затем связать его с помощью IBOutlet
@interface SomeViewController: UIViewController
{
IBOutlet UIView *blackView;
}
затем в методе UIViewController
-(void) viewDidLoad;
я бы сделал следующее
- (void)viewDidLoad
{
[super viewDidLoad];
// Fade the opacity of blackView over 1 second,
// then remove it from the view controller.
[UIView animateWithDuration:1
delay:0
options:UIViewAnimationOptionCurveEaseOut
animations:^{
blackView.layer.opacity = 0;
}
completion:^(BOOL finished) {
// This line prevents the flash
blackView.layer.opacity = 0;
[blackView removeFromSuperview];
}];
}