From 580feff6aae5477c2d94032fa915e9322a3f54aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Spie=C3=9F?= Date: Sat, 5 Mar 2016 16:12:36 +0100 Subject: [PATCH] Deprecate feedbackComposerPreparedItems in favor of delegate method --- Classes/BITFeedbackManager.h | 11 +++++++++-- Classes/BITFeedbackManager.m | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Classes/BITFeedbackManager.h b/Classes/BITFeedbackManager.h index 0763df67b3..f4e568e741 100644 --- a/Classes/BITFeedbackManager.h +++ b/Classes/BITFeedbackManager.h @@ -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. diff --git a/Classes/BITFeedbackManager.m b/Classes/BITFeedbackManager.m index 235b1ec63c..3135f31847 100644 --- a/Classes/BITFeedbackManager.m +++ b/Classes/BITFeedbackManager.m @@ -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]]; }