Skip to content

Commit

Permalink
A bit verbose but gets the idea across. Now the buttons are visible o…
Browse files Browse the repository at this point in the history
…n the button of view.
  • Loading branch information
NorthStar committed Aug 6, 2014
1 parent f8dc08f commit 4a4bd8a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions RoutableExample/UPAppDelegate.m
Expand Up @@ -29,6 +29,7 @@ - (void)viewDidLoad {
[modal setTitle:@"Modal" forState:UIControlStateNormal];
[modal addTarget:self action:@selector(tapped:) forControlEvents:UIControlEventTouchUpInside];
[modal sizeToFit];
[modal setFrame:CGRectMake(0, self.view.bounds.size.height - modal.frame.size.height, modal.frame.size.width, modal.frame.size.height)];

[self.view addSubview:modal];
}
Expand Down Expand Up @@ -59,14 +60,14 @@ - (void)viewDidLoad {
[modal setTitle:@"Close" forState:UIControlStateNormal];
[modal addTarget:self action:@selector(tapped:) forControlEvents:UIControlEventTouchUpInside];
[modal sizeToFit];

[modal setFrame:CGRectMake(0, self.view.bounds.size.height - modal.frame.size.height, modal.frame.size.width, modal.frame.size.height)];
[self.view addSubview:modal];

UIButton *user = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[user setTitle:@"User" forState:UIControlStateNormal];
[user addTarget:self action:@selector(tappedUser:) forControlEvents:UIControlEventTouchUpInside];
[user sizeToFit];
[user setFrame:CGRectMake(modal.frame.size.width, 0, user.frame.size.width, user.frame.size.width)];
[user setFrame:CGRectMake(self.view.bounds.size.width - user.frame.size.width , self.view.bounds.size.height - user.frame.size.height, user.frame.size.width, user.frame.size.height)];

[self.view addSubview:user];
}
Expand Down

0 comments on commit 4a4bd8a

Please sign in to comment.