I am trying to create my first iphone app and I have a view that is supposed to be pitch black. My view is connected to my controller properly (my label shows when I run the simulator).
I want to add a black layer (so the screen looks like the iphone is off). Not only this, when the user pushes or interacts with the screen it should only be triggering those actions onto the black layer. I will have something underneath that layer, like a label persay.
When I set the brightness to 0.0 in my controller and run the simulator it still shows the view:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
[[UIScreen mainScreen] setBrightness: 0.0]; //<-- here
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
[[UIScreen mainScreen] setBrightness: 0.0]; //<-- here as well. but nothing happens
self.navigationItem.hidesBackButton = YES;
// Do any additional setup after loading the view.
}
Also, I feel like setting the brightness would still allow the user to interact with the screen, which isn't what I want. Could anyone help? Could I just add a black image or something?