File tree Expand file tree Collapse file tree
Examples/Messenger-Shared Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -194,18 +194,23 @@ - (void)simulateUserTyping:(id)sender
194194- (void )didLongPressCell : (UIGestureRecognizer *)gesture
195195{
196196#ifdef __IPHONE_8_0
197- UIAlertController *alertController = [UIAlertController alertControllerWithTitle: nil message: nil preferredStyle: UIAlertControllerStyleActionSheet];
198- alertController.modalPresentationStyle = UIModalPresentationPopover;
199- alertController.popoverPresentationController .sourceView = gesture.view .superview ;
200- alertController.popoverPresentationController .sourceRect = gesture.view .frame ;
201-
202- [alertController addAction: [UIAlertAction actionWithTitle: @" Edit Message" style: UIAlertActionStyleDefault handler: ^(UIAlertAction *action) {
197+ if ([UIAlertController class ]) {
198+ UIAlertController *alertController = [UIAlertController alertControllerWithTitle: nil message: nil preferredStyle: UIAlertControllerStyleActionSheet];
199+ alertController.modalPresentationStyle = UIModalPresentationPopover;
200+ alertController.popoverPresentationController .sourceView = gesture.view .superview ;
201+ alertController.popoverPresentationController .sourceRect = gesture.view .frame ;
202+
203+ [alertController addAction: [UIAlertAction actionWithTitle: @" Edit Message" style: UIAlertActionStyleDefault handler: ^(UIAlertAction *action) {
204+ [self editCellMessage: gesture];
205+ }]];
206+
207+ [alertController addAction: [UIAlertAction actionWithTitle: @" Cancel" style: UIAlertActionStyleCancel handler: NULL ]];
208+
209+ [self .navigationController presentViewController: alertController animated: YES completion: nil ];
210+ }
211+ else {
203212 [self editCellMessage: gesture];
204- }]];
205-
206- [alertController addAction: [UIAlertAction actionWithTitle: @" Cancel" style: UIAlertActionStyleCancel handler: NULL ]];
207-
208- [self .navigationController presentViewController: alertController animated: YES completion: nil ];
213+ }
209214#else
210215 [self editCellMessage: gesture];
211216#endif
You can’t perform that action at this time.
0 commit comments