Reputation: 1318
I'm trying to add something like this to my program but idk what it's called.
I'm talking about the buttons that pop up "Photo Library" "Take Photo or Video" "Cancel"
Upvotes: 0
Views: 63
Reputation: 66
It's a UIAlertController
with style UIAlertControllerStyleActionSheet
.
You use it like this:
UIAlertController *aC = [UIAlertController alertControllerWithTitle:@"Title"
message:@"Message"
preferredStyle:UIAlertControllerStyleActionSheet];
[aC addAction:[UIAlertAction actionWithTitle:@"Button 1"
// Style can be default, destructive or cancel
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {
// handler
}]];
// Add more actions (buttons) here if needed
// Assuming you're in your view controller,
// present the alert view controller like this:
[self presentViewController:aC animated:YES completion:nil];
Upvotes: 1