Deprecate feedbackComposerPreparedItems in favor of delegate method

This commit is contained in:
Lukas Spieß
2016-03-05 16:12:36 +01:00
parent c6da440509
commit 580feff6aa
2 changed files with 12 additions and 2 deletions

View File

@@ -232,9 +232,11 @@ typedef NS_ENUM(NSInteger, BITFeedbackObservationMode) {
All NSString-Content in the array will be concatenated and result in the message,
while all UIImage and NSData-instances will be turned into attachments.
@deprecated This property is deprecated in favor of `BITFeedbackManagerDelegate preparedItemsForFeedbackManager:`.
@see `[BITFeedbackComposeViewController prepareWithItems:]`
*/
@property (nonatomic, copy) NSArray *feedbackComposerPreparedItems;
@property (nonatomic, copy, nullable) NSArray *feedbackComposerPreparedItems DEPRECATED_MSG_ATTRIBUTE("Use -preparedItemsForFeedbackManager: delegate method instead.");
/**
@@ -318,11 +320,16 @@ typedef NS_ENUM(NSInteger, BITFeedbackObservationMode) {
All NSString-Content in the array will be concatenated and result in the message,
while all UIImage and NSData-instances will be turned into attachments.
Alternatively you can implement the `preparedItemsForFeedbackManager:` delegate method
and call `showFeedbackComposeView` instead. If you use both, the items from the delegate method
and the items passed with this method will be combined.
@param items an NSArray with objects that should be attached
@see `[BITFeedbackComposeViewController prepareWithItems:]`
@see `BITFeedbackManagerDelegate preparedItemsForFeedbackManager:`
@warning This methods needs to be called on the main thread!
*/
- (void)showFeedbackComposeViewWithPreparedItems:(NSArray *)items;
- (void)showFeedbackComposeViewWithPreparedItems:(nullable NSArray *)items;
/**
Presents a modal feedback compose interface with a screenshot attached which is taken at the time of calling this method.

View File

@@ -232,7 +232,10 @@ typedef void (^BITLatestImageFetchCompletionBlock)(UIImage *_Nonnull latestImage
- (BITFeedbackComposeViewController *)feedbackComposeViewController {
BITFeedbackComposeViewController *composeViewController = [[BITFeedbackComposeViewController alloc] init];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
NSArray *preparedItems = self.feedbackComposerPreparedItems;
#pragma clang diagnostic pop
if ([self.delegate respondsToSelector:@selector(preparedItemsForFeedbackManager:)]) {
preparedItems = [preparedItems arrayByAddingObjectsFromArray:[self.delegate preparedItemsForFeedbackManager:self]];
}