Add option to hide "Add Image" attachment button

This commit is contained in:
Andreas Linde
2015-05-12 12:25:03 +02:00
parent 469ef20021
commit 167358f25c
4 changed files with 25 additions and 1 deletions

View File

@@ -69,6 +69,14 @@
///----------------------------------------------------------------------------- ///-----------------------------------------------------------------------------
/**
Don't show the option to add images from the photo library
This is helpful if your application is landscape only, since the system UI for
selecting an image from the photo library is portrait only
*/
@property (nonatomic) BOOL hideImageAttachmentButton;
/** /**
An array of data objects that should be used to prefill the compose view content An array of data objects that should be used to prefill the compose view content

View File

@@ -248,7 +248,9 @@
[self.textAccessoryView addSubview:self.addPhotoButton]; [self.textAccessoryView addSubview:self.addPhotoButton];
if (!self.hideImageAttachmentButton) {
self.textView.inputAccessoryView = self.textAccessoryView; self.textView.inputAccessoryView = self.textAccessoryView;
}
// This could be a subclass, yet // This could be a subclass, yet
self.attachmentScrollView = [[UIScrollView alloc] initWithFrame:CGRectZero]; self.attachmentScrollView = [[UIScrollView alloc] initWithFrame:CGRectZero];

View File

@@ -234,6 +234,19 @@ typedef NS_ENUM(NSInteger, BITFeedbackObservationMode) {
@property (nonatomic, copy) NSArray *feedbackComposerPreparedItems; @property (nonatomic, copy) NSArray *feedbackComposerPreparedItems;
/**
Don't show the option to add images from the photo library
This is helpful if your application is landscape only, since the system UI for
selecting an image from the photo library is portrait only
This setting is used for all feedback compose views that are created by the
`BITFeedbackManager`. If you invoke your own `BITFeedbackComposeViewController`,
then set the appropriate property on the view controller directl!.
*/
@property (nonatomic) BOOL feedbackComposeHideImageAttachmentButton;
///----------------------------------------------------------------------------- ///-----------------------------------------------------------------------------
/// @name User Interface /// @name User Interface
///----------------------------------------------------------------------------- ///-----------------------------------------------------------------------------

View File

@@ -225,6 +225,7 @@ NSString *const kBITFeedbackUpdateAttachmentThumbnail = @"BITFeedbackUpdateAttac
- (BITFeedbackComposeViewController *)feedbackComposeViewController { - (BITFeedbackComposeViewController *)feedbackComposeViewController {
BITFeedbackComposeViewController *composeViewController = [[BITFeedbackComposeViewController alloc] init]; BITFeedbackComposeViewController *composeViewController = [[BITFeedbackComposeViewController alloc] init];
[composeViewController prepareWithItems:self.feedbackComposerPreparedItems]; [composeViewController prepareWithItems:self.feedbackComposerPreparedItems];
[composeViewController setHideImageAttachmentButton:self.feedbackComposeHideImageAttachmentButton];
// by default set the delegate to be identical to the one of BITFeedbackManager // by default set the delegate to be identical to the one of BITFeedbackManager
[composeViewController setDelegate:self.delegate]; [composeViewController setDelegate:self.delegate];