Last active
August 29, 2015 14:14
-
-
Save blixt/dc2540645c4da50adab7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set up the container for the buttons that appear when swiping. | |
UIView *buttonsView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 160, self.bounds.size.height)]; | |
buttonsView.autoresizingMask = UIViewAutoresizingFlexibleHeight; | |
self.buttonsView = buttonsView; | |
[self.scrollView insertSubview:buttonsView atIndex:0]; | |
// Create two action buttons and put them in the container. | |
UIButton *yesButton = [UIButton buttonWithType:UIButtonTypeCustom]; | |
yesButton.autoresizingMask = UIViewAutoresizingFlexibleHeight; | |
yesButton.backgroundColor = [UIColor greenColor]; | |
yesButton.frame = CGRectMake(0, 0, 80, self.bounds.size.height); | |
[yesButton setTitle:@"Yes" forState:UIControlStateNormal]; | |
[yesButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | |
[self.buttonsView addSubview:yesButton]; | |
UIButton *noButton = [UIButton buttonWithType:UIButtonTypeCustom]; | |
noButton.autoresizingMask = UIViewAutoresizingFlexibleHeight; | |
noButton.backgroundColor = [UIColor redColor]; | |
noButton.frame = CGRectMake(80, 0, 80, self.bounds.size.height); | |
[noButton setTitle:@"No" forState:UIControlStateNormal]; | |
[noButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | |
[self.buttonsView addSubview:noButton]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment