I wanted to add a view in UIWindow with following code:
UIWindow
AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate; UIWindo
You can try below code...for adding subview to window
UIView *aView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 100, 100)]; aView.backgroundColor = [UIColor blackColor]; [[UIApplication sharedApplication].keyWindow addSubview:aView];
//Removing
[aView removeFromSuperview];
Hope it helps you..!