Skip to content

Instantly share code, notes, and snippets.

@AllieCarver
Created May 9, 2017 16:32
Show Gist options
  • Save AllieCarver/fcb4ce936b1b2bec02dff8b9fd0b33a9 to your computer and use it in GitHub Desktop.
Save AllieCarver/fcb4ce936b1b2bec02dff8b9fd0b33a9 to your computer and use it in GitHub Desktop.
CGRect viewRect = CGRectMake(0, 0, 100, 100);
UIColor * greyColor = [UIColor colorWithRed:230.0/255.0 green:230.0/255.0 blue:230.0/255.0 alpha:1.0];
[greyColor setFill];
UIRectFill( viewRect );
UIViewController *rootViewController = [[UIApplication sharedApplication] keyWindow].rootViewController;
UIView* myView = [[UIView alloc] initWithFrame:viewRect];
myView.backgroundColor = greyColor;
[rootViewController.view addSubview:myView];
return self;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment