Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Makes property 'presentedInPopover' compatible only with iPad (no nee…
Browse files Browse the repository at this point in the history
…d for this on iPhone)
  • Loading branch information
dzenbot committed Oct 31, 2014
1 parent 1c358e3 commit 1f72889
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Classes/SLKTextViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ typedef NS_ENUM(NSUInteger, SLKKeyboardStatus) {
};

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

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

/** 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. */
/** 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. */
@property (nonatomic, getter = isPresentedInPopover) BOOL presentedInPopover;

/** Convenience accessors (accessed through the text input bar) */
Expand Down
5 changes: 5 additions & 0 deletions Source/Classes/SLKTextViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ - (BOOL)isEditing
return NO;
}

- (BOOL)isPresentedInPopover
{
return _presentedInPopover && UI_IS_IPAD;
}

- (SLKTextView *)textView
{
return self.textInputbar.textView;
Expand Down

0 comments on commit 1f72889

Please sign in to comment.