Skip to content

Commit 1f72889

Browse files
author
dzenbot
committed
Makes property 'presentedInPopover' compatible only with iPad (no need for this on iPhone)
1 parent 1c358e3 commit 1f72889

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Source/Classes/SLKTextViewController.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ typedef NS_ENUM(NSUInteger, SLKKeyboardStatus) {
3939
};
4040

4141
/** @name A drop-in UIViewController subclass with a growing text input view and other useful messaging features. */
42-
@interface SLKTextViewController : UIViewController <UITextViewDelegate, UITableViewDelegate, UITableViewDataSource, UICollectionViewDelegate, UICollectionViewDataSource>
42+
NS_CLASS_AVAILABLE_IOS(7_0) @interface SLKTextViewController : UIViewController <UITextViewDelegate, UITableViewDelegate, UITableViewDataSource, UICollectionViewDelegate, UICollectionViewDataSource>
4343

4444
/** The main table view managed by the controller object. Created by default initializing with -init or initWithNibName:bundle: */
4545
@property (nonatomic, readonly) UITableView *tableView;
@@ -88,7 +88,7 @@ typedef NS_ENUM(NSUInteger, SLKKeyboardStatus) {
8888
*/
8989
@property (nonatomic, assign, getter = isInverted) BOOL inverted;
9090

91-
/** YES if the view controller is presented inside of a popover controller. If YES, the keyboard won't move the text input bar and tapping on the tableView/collectionView will not cause the keyboard to be dismissed. This doesn't do anything on iPhone. */
91+
/** YES if the view controller is presented inside of a popover controller. If YES, the keyboard won't move the text input bar and tapping on the tableView/collectionView will not cause the keyboard to be dismissed. This property is compatible only with iPad. */
9292
@property (nonatomic, getter = isPresentedInPopover) BOOL presentedInPopover;
9393

9494
/** Convenience accessors (accessed through the text input bar) */

Source/Classes/SLKTextViewController.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,11 @@ - (BOOL)isEditing
304304
return NO;
305305
}
306306

307+
- (BOOL)isPresentedInPopover
308+
{
309+
return _presentedInPopover && UI_IS_IPAD;
310+
}
311+
307312
- (SLKTextView *)textView
308313
{
309314
return self.textInputbar.textView;

0 commit comments

Comments
 (0)