Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @implementation WelcomeViewController
- - (UIButton *)signInButton {
- UIButton *button = [[UIButton alloc] init];
- button.backgroundColor = [UIColor systemRedColor];
- button.layer.borderWidth = 2;
- button.clipsToBounds = YES;
- [button setTitle:@"Apple IDでログイン" forState:UIControlStateNormal];
- [button setTitleColor:[UIColor systemBackgroundColor] forState:UIControlStateNormal];
- return button;
- }
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
- self.title = @"タイトル";
- self.view.backgroundColor = [UIColor systemGreenColor];
- // UIButton *button = [[UIButton alloc] init];
- // button.backgroundColor = [UIColor clearColor];
- // button.layer.borderWidth = 2;
- // button.clipsToBounds = YES;
- //
- // [button setTitle:@"Apple IDでログイン" forState:UIControlStateNormal];
- // [button setTitleColor:[UIColor systemBackgroundColor] forState:UIControlStateNormal];
- //
- // self.signInButton = button;
- [self.view addSubview:self.signInButton];
- }
- - (void)viewDidLayoutSubviews {
- [super viewDidLayoutSubviews];
- self.signInButton.frame = CGRectMake(20, self.view.frame.size.height - 50 - self.view.safeAreaInsets.bottom, self.view.frame.size.width * 0.9, 50);
- self.signInButton.layer.cornerRadius = self.signInButton.frame.size.height / 2;
- [self.signInButton addTarget:self action:@selector(handlePress:) forControlEvents:UIControlEventTouchUpInside];
- }
- - (void)handlePress: (UIButton *) sender {
- printf("Button pressed!");
- }
- @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement