File tree Expand file tree Collapse file tree 2 files changed +18
-20
lines changed
Examples/Messenger-Shared Expand file tree Collapse file tree 2 files changed +18
-20
lines changed Original file line number Diff line number Diff line change @@ -194,18 +194,23 @@ - (void)simulateUserTyping:(id)sender
194
194
- (void )didLongPressCell : (UIGestureRecognizer *)gesture
195
195
{
196
196
#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 {
203
212
[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
+ }
209
214
#else
210
215
[self editCellMessage: gesture];
211
216
#endif
Original file line number Diff line number Diff line change @@ -700,23 +700,16 @@ - (void)editText:(NSString *)text
700
700
// Caches the current text, in case the user cancels the edition
701
701
[self slk_cacheTextToDisk: self .textView.text];
702
702
703
- if (!SLK_IS_LANDSCAPE) {
704
- [self .textView setText: text];
705
- }
706
-
707
703
[self .textInputbar beginTextEditing ];
708
704
709
- // Setting the text after calling -beginTextEditing is safer when on landscape orientation
710
- if (SLK_IS_LANDSCAPE) {
711
- [self .textView setText: text];
712
- }
705
+ // Setting the text after calling -beginTextEditing is safer
706
+ [self .textView setText: text];
713
707
714
708
[self .textView slk_scrollToCaretPositonAnimated: YES ];
715
709
716
710
// Brings up the keyboard if needed
717
711
[self presentKeyboard: YES ];
718
712
}
719
-
720
713
- (void )didCommitTextEditing : (id )sender
721
714
{
722
715
if (!self.textInputbar .isEditing ) {
You can’t perform that action at this time.
0 commit comments