TestViewController.m
1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// TestViewController.m
// CNLivePublishContent
//
// Created by 殷巧娟 on 2019/1/16.
//
#import "TestViewController.h"
@interface TestViewController ()
@property (nonatomic, strong) UILabel *nameLabel;
@end
@implementation TestViewController
-(instancetype)initWithName:(NSString *)name {
self = [super init];
if (self) {
_nameLabel.text = name;
}
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
NSLog(@"测试一下啊啊啊啊");
_nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(100, 100, 200, 50)];
_nameLabel.textColor = [UIColor blackColor];
_nameLabel.backgroundColor = [UIColor cyanColor];
[self.view addSubview:_nameLabel];
// Do any additional setup after loading the view.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end