UIView *v1 = [[UIView alloc] init]; [self.view addSubview:v1]; UIView *v2 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)]; v2.backgroundColor = [UIColor redColor]; [v1 addSubview:v2];