Ich möchte einen UIAlertController aus der Zelle einer UICollectionView zeigen.UIAlertController von UICollectionViewCell
UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *deleteAction = [UIAlertAction actionWithTitle:@"Delete" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
}];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
}];
[alert addAction:deleteAction];
[alert addAction:cancelAction];
[self presentViewController:alert animated:YES completion:nil];
Das Problem ist, dass die Zelle nicht hat [self presentViewController: alert animierte: JA Abschluss: nil]; Methode.
Vielleicht kann mir jemand helfen?
Theis Lösung mit dem Delegierten funktioniert gut, aber es gibt einen anderen guten Weg, das zu tun. [self.window.rootViewController presentViewController: Warnung animiert: YES completion: nil]; Beide machen ihre Arbeit. – ViceBrot