Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added deletePhotoAtIndex: #175

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions Classes/IDMPhoto.m
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ - (void)loadUnderlyingImageAndNotify {
} else if (_photoURL) {
// Load async from web (using SDWebImageManager)
SDWebImageManager *manager = [SDWebImageManager sharedManager];
[manager downloadImageWithURL:_photoURL options:SDWebImageRetryFailed progress:^(NSInteger receivedSize, NSInteger expectedSize) {
[manager loadImageWithURL:_photoURL options:SDWebImageRetryFailed|SDWebImageHandleCookies progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) {
CGFloat progress = ((CGFloat)receivedSize)/((CGFloat)expectedSize);
if (self.progressUpdateBlock) {
self.progressUpdateBlock(progress);
}
} completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
} completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
if (image) {
self.underlyingImage = image;
[self performSelectorOnMainThread:@selector(imageLoadingComplete) withObject:nil waitUntilDone:NO];
Expand Down
12 changes: 10 additions & 2 deletions Classes/IDMPhotoBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@
- (void)photoBrowser:(IDMPhotoBrowser *)photoBrowser didDismissAtPageIndex:(NSUInteger)index;
- (void)photoBrowser:(IDMPhotoBrowser *)photoBrowser willDismissAtPageIndex:(NSUInteger)index;
- (void)photoBrowser:(IDMPhotoBrowser *)photoBrowser didDismissActionSheetWithButtonIndex:(NSUInteger)buttonIndex photoIndex:(NSUInteger)photoIndex;
- (void)photoBrowser:(IDMPhotoBrowser *)photoBrowser deleteButtonDidTappedWithPhotoIndex:(NSUInteger)photoIndex;
- (void)photoBrowser:(IDMPhotoBrowser *)photoBrowser actionButtonDidTappedWithPhotoIndex:(NSUInteger)photoIndex;
- (IDMCaptionView *)photoBrowser:(IDMPhotoBrowser *)photoBrowser captionViewForPhotoAtIndex:(NSUInteger)index;
@end

// IDMPhotoBrowser
@interface IDMPhotoBrowser : UIViewController <UIScrollViewDelegate, UIActionSheetDelegate>
@interface IDMPhotoBrowser : UIViewController <UIScrollViewDelegate, UIActionSheetDelegate>

// Properties
@property (nonatomic, strong) id <IDMPhotoBrowserDelegate> delegate;
Expand All @@ -41,16 +43,19 @@

// View customization
@property (nonatomic) BOOL displayDoneButton;
@property (nonatomic) BOOL displayDeleteButton;
@property (nonatomic) BOOL useWhiteBackgroundColor;
@property (nonatomic, weak) UIImage *doneButtonImage;
@property (nonatomic, weak) UIColor *doneButtonBorderColor;
@property (nonatomic, weak) UIColor *doneButtonTitleColor;
@property (nonatomic, copy) NSString *doneButtonTitle;
@property (nonatomic, weak) UIColor *trackTintColor, *progressTintColor;

@property (nonatomic, weak) UIImage *scaleImage;

@property (nonatomic) BOOL arrowButtonsChangePhotosAnimated;

@property (nonatomic) BOOL forceHideStatusBar;
@property (nonatomic) BOOL usePopAnimation;
@property (nonatomic) BOOL disableVerticalSwipe;

// defines zooming of the background (default 1.0)
Expand Down Expand Up @@ -80,4 +85,7 @@
// Get IDMPhoto at index
- (id<IDMPhoto>)photoAtIndex:(NSUInteger)index;

// Delete the photo at index
- (void)deletePhotoAtIndex:(NSUInteger)index;

@end
Loading