Skip to content

Instantly share code, notes, and snippets.

@cyndibaby905
Last active January 3, 2016 10:59
Show Gist options
  • Save cyndibaby905/8453396 to your computer and use it in GitHub Desktop.
Save cyndibaby905/8453396 to your computer and use it in GitHub Desktop.
How to write a modal view
UIViewController* avc = [[UIViewController alloc] init];
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(50,50,100,100)];
view.backgroundColor = [UIColor redColor];
[avc.view addSubview:view];
UIWindow* ow = [[UIWindow alloc] initWithFrame: [UIScreen mainScreen].bounds];
ow.windowLevel = UIWindowLevelAlert;
ow.backgroundColor = [UIColor clearColor];
ow.rootViewController = avc;
[ow makeKeyAndVisible];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment