-
Notifications
You must be signed in to change notification settings - Fork 97
Added a new property for single selection image size. #19
Conversation
Added test code in demo.
Thank you for submitting this pull request, however I do not see a valid CLA on file for you. Before we can merge this request please visit https://yahoocla.herokuapp.com/ and agree to the terms. Thanks! 😄 |
CLA is valid! |
/** | ||
* @brief Use this property to customize the returned item type for single selection. Default value is NO. | ||
*/ | ||
@property (nonatomic, assign) BOOL shouldReturnAssetForSingleSelection; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After discussing with @stewwu, we'd agree return Asset is a better behavior.
However, we also want to make this change backward compatible. Thus, how about renaming this new property to shouldReturnImageForSingleSelection with default YES ?
@@ -213,6 +214,12 @@ - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPa | |||
if (indexPath.row == 0) { | |||
[self yms_presentCameraCaptureViewWithDelegate:self]; | |||
} | |||
else if (self.shouldReturnAssetForSingleSelection) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about moving this condition checking under line 223 ?
This would prevent user enable multipleSelection and return Asset/Image at the same time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yzlai Please review my latest commit.
Moved condition check under (self.allowsMultipleSelection) due to yzlai's comment. Deleted demo test code.
For the reason of reducing memory usage, I strongly recommend to add this property for resizing single selection image. The current project only returns an origin image which is not enough.