Skip to content

Commit

Permalink
Update to iOS 13, use SF Symbols, fixed deprecations, version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
DreamingInBinary committed May 13, 2021
1 parent 3264030 commit cc58637
Show file tree
Hide file tree
Showing 83 changed files with 586 additions and 549 deletions.
4 changes: 2 additions & 2 deletions BFRImageViewController/BFRImageContainerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ - (void)presentActivityController {
if (activityItem == nil) return;

UIActivityViewController *activityVC;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) {
activityVC = [[UIActivityViewController alloc] initWithActivityItems:@[activityItem] applicationActivities:nil];
[self presentViewController:activityVC animated:YES completion:nil];
} else {
Expand Down Expand Up @@ -441,7 +441,7 @@ - (void)retrieveImageFromAsset {
PHImageRequestOptions *reqOptions = [PHImageRequestOptions new];
reqOptions.synchronous = YES;

[[PHImageManager defaultManager] requestImageDataForAsset:self.imgSrc options:reqOptions resultHandler:^(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info) {
[[PHImageManager defaultManager] requestImageDataAndOrientationForAsset:self.imgSrc options:reqOptions resultHandler:^(NSData * _Nullable imageData, NSString * _Nullable dataUTI, CGImagePropertyOrientation orientation, NSDictionary * _Nullable info) {
self.imgLoaded = [UIImage imageWithData:imageData];
[self addImageToScrollView];
}];
Expand Down
6 changes: 3 additions & 3 deletions BFRImageViewController/BFRImageViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ - (void)reinitializeUI {

- (void)addChromeToUI {
if (self.enableDoneButton) {
NSBundle *bundle = [NSBundle bundleForClass:[BFRImageViewController class]];
NSString *imagePath = [bundle pathForResource:@"cross" ofType:@"png"];
UIImage *crossImage = [[UIImage alloc] initWithContentsOfFile:imagePath];
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithWeight:UIImageSymbolWeightBold];
UIImage *crossImage = [UIImage systemImageNamed:@"xmark" withConfiguration:config];

self.doneButton = [UIButton buttonWithType:UIButtonTypeCustom];
self.doneButton.tintColor = [UIColor whiteColor];
[self.doneButton setAccessibilityLabel:BFRImageViewerLocalizedStrings(@"imageViewController.closeButton.text", @"Close")];
[self.doneButton setImage:crossImage forState:UIControlStateNormal];
[self.doneButton addTarget:self action:@selector(handleDoneAction) forControlEvents:UIControlEventTouchUpInside];
Expand Down
Binary file removed BFRImageViewController/Resources/cross.png
Binary file not shown.
Binary file removed BFRImageViewController/Resources/[email protected]
Binary file not shown.
Binary file removed BFRImageViewController/Resources/[email protected]
Binary file not shown.
Binary file modified BFRImageViewController/Resources/lowResImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions BFRImageViewer.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "BFRImageViewer"
s.version = "1.2.9"
s.version = "1.3.0"
s.summary = "A turnkey solution to display photos and images of all kinds in your app."
s.description = <<-DESC
The BFRImageViewer is a turnkey solution to present images within your iOS app 🎉!
Expand All @@ -13,11 +13,11 @@ Pod::Spec.new do |s|
s.authors = {"Andrew Yates" => "[email protected]",
"Jordan Morgan" => "[email protected]"}
s.social_media_url = "https://twitter.com/bufferdevs"
s.source = { :git => "https://github.com/bufferapp/buffer-ios-image-viewer.git", :tag => '1.2.9' }
s.source = { :git => "https://github.com/bufferapp/buffer-ios-image-viewer.git", :tag => '1.3.0' }
s.source_files = 'Classes', 'BFRImageViewController/**/*.{h,m}'
s.resources = ['BFRImageViewController/**/BFRImageViewerLocalizations.bundle','BFRImageViewController/**/*.{png}']
s.resources = ['BFRImageViewController/**/BFRImageViewerLocalizations.bundle']
s.exclude_files = 'BFRImageViewController/**/lowResImage.png'
s.platform = :ios, '11.0'
s.platform = :ios, '13.0'
s.requires_arc = true
s.frameworks = "UIKit", "Photos"
s.dependency 'PINRemoteImage/iOS', '~> 3.0.0'
Expand Down
32 changes: 11 additions & 21 deletions BFRImageViewerDemo/BFRImageViewer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@

/* Begin PBXBuildFile section */
1702C69A1F86BBFC00104D0B /* BFRImageViewerConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 1702C6991F86BBFC00104D0B /* BFRImageViewerConstants.m */; };
1702C69C1F86C3A400104D0B /* lowResImage.png in Resources */ = {isa = PBXBuildFile; fileRef = 1702C69B1F86C32100104D0B /* lowResImage.png */; };
170BE4FF212DBB2B005703C6 /* BFRImageViewerDownloadProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = 170BE4FE212DBB2B005703C6 /* BFRImageViewerDownloadProgressView.m */; };
171F4AD01E96BE0500F4AF01 /* BFRBackLoadedImageSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 171F4ACF1E96BE0500F4AF01 /* BFRBackLoadedImageSource.m */; };
171F4AD31E96C31400F4AF01 /* FourthViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 171F4AD21E96C31400F4AF01 /* FourthViewController.m */; };
1797CB8E1E81BB4F00D9F729 /* BFRImageTransitionAnimator.m in Sources */ = {isa = PBXBuildFile; fileRef = 1797CB8D1E81BB4F00D9F729 /* BFRImageTransitionAnimator.m */; };
1797CB911E81BBB200D9F729 /* ThirdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1797CB901E81BBB200D9F729 /* ThirdViewController.m */; };
17C1AAB61D9D6EBF00FF1B67 /* BFRImageViewerLocalizations.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 17C1AAB51D9D6EBF00FF1B67 /* BFRImageViewerLocalizations.bundle */; };
33625B75264D71130003310C /* lowResImage.png in Resources */ = {isa = PBXBuildFile; fileRef = 33625B74264D71130003310C /* lowResImage.png */; };
3D65F036BBCC181E7FD291F7 /* libPods-BFRImageViewer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 76763DB871F085556628E1C6 /* libPods-BFRImageViewer.a */; };
578DFD5B1CB6F17B00BFBD00 /* cross.png in Resources */ = {isa = PBXBuildFile; fileRef = 578DFD581CB6F17B00BFBD00 /* cross.png */; };
578DFD5C1CB6F17B00BFBD00 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 578DFD591CB6F17B00BFBD00 /* [email protected] */; };
578DFD5D1CB6F17B00BFBD00 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 578DFD5A1CB6F17B00BFBD00 /* [email protected] */; };
944B4DB01BFFC0C000B9BF87 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 944B4DAF1BFFC0C000B9BF87 /* main.m */; };
944B4DB31BFFC0C000B9BF87 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 944B4DB21BFFC0C000B9BF87 /* AppDelegate.m */; };
944B4DB61BFFC0C000B9BF87 /* FirstViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 944B4DB51BFFC0C000B9BF87 /* FirstViewController.m */; };
Expand All @@ -33,7 +30,6 @@
1264A436520DEA8753316972 /* Pods-BFRImageViewer.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BFRImageViewer.release.xcconfig"; path = "Pods/Target Support Files/Pods-BFRImageViewer/Pods-BFRImageViewer.release.xcconfig"; sourceTree = "<group>"; };
1702C6981F86BBFC00104D0B /* BFRImageViewerConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BFRImageViewerConstants.h; sourceTree = "<group>"; };
1702C6991F86BBFC00104D0B /* BFRImageViewerConstants.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BFRImageViewerConstants.m; sourceTree = "<group>"; };
1702C69B1F86C32100104D0B /* lowResImage.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = lowResImage.png; sourceTree = "<group>"; };
170BE4FD212DBB2B005703C6 /* BFRImageViewerDownloadProgressView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BFRImageViewerDownloadProgressView.h; sourceTree = "<group>"; };
170BE4FE212DBB2B005703C6 /* BFRImageViewerDownloadProgressView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BFRImageViewerDownloadProgressView.m; sourceTree = "<group>"; };
171F4ACE1E96BE0500F4AF01 /* BFRBackLoadedImageSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BFRBackLoadedImageSource.h; sourceTree = "<group>"; };
Expand All @@ -46,10 +42,8 @@
1797CB901E81BBB200D9F729 /* ThirdViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ThirdViewController.m; sourceTree = "<group>"; };
17C1AAB51D9D6EBF00FF1B67 /* BFRImageViewerLocalizations.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = BFRImageViewerLocalizations.bundle; sourceTree = "<group>"; };
17C1AAB91D9D702E00FF1B67 /* BFRImageViewerLocalizations.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BFRImageViewerLocalizations.h; sourceTree = "<group>"; };
33625B74264D71130003310C /* lowResImage.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = lowResImage.png; sourceTree = "<group>"; };
3C46F30D2C78F64E6BC23C87 /* Pods-BFRImageViewer.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BFRImageViewer.debug.xcconfig"; path = "Pods/Target Support Files/Pods-BFRImageViewer/Pods-BFRImageViewer.debug.xcconfig"; sourceTree = "<group>"; };
578DFD581CB6F17B00BFBD00 /* cross.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cross.png; sourceTree = "<group>"; };
578DFD591CB6F17B00BFBD00 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
578DFD5A1CB6F17B00BFBD00 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
76763DB871F085556628E1C6 /* libPods-BFRImageViewer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BFRImageViewer.a"; sourceTree = BUILT_PRODUCTS_DIR; };
944B4DAB1BFFC0C000B9BF87 /* BFRImageViewer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BFRImageViewer.app; sourceTree = BUILT_PRODUCTS_DIR; };
944B4DAF1BFFC0C000B9BF87 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -92,10 +86,7 @@
578DFD551CB6E7F400BFBD00 /* Resources */ = {
isa = PBXGroup;
children = (
1702C69B1F86C32100104D0B /* lowResImage.png */,
578DFD581CB6F17B00BFBD00 /* cross.png */,
578DFD591CB6F17B00BFBD00 /* [email protected] */,
578DFD5A1CB6F17B00BFBD00 /* [email protected] */,
33625B74264D71130003310C /* lowResImage.png */,
17C1AAB51D9D6EBF00FF1B67 /* BFRImageViewerLocalizations.bundle */,
);
path = Resources;
Expand Down Expand Up @@ -208,7 +199,7 @@
944B4DA31BFFC0C000B9BF87 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1010;
LastUpgradeCheck = 1250;
ORGANIZATIONNAME = "Andrew Yates";
TargetAttributes = {
944B4DAA1BFFC0C000B9BF87 = {
Expand Down Expand Up @@ -240,12 +231,9 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1702C69C1F86C3A400104D0B /* lowResImage.png in Resources */,
578DFD5C1CB6F17B00BFBD00 /* [email protected] in Resources */,
944B4DC11BFFC0C000B9BF87 /* LaunchScreen.storyboard in Resources */,
578DFD5D1CB6F17B00BFBD00 /* [email protected] in Resources */,
578DFD5B1CB6F17B00BFBD00 /* cross.png in Resources */,
17C1AAB61D9D6EBF00FF1B67 /* BFRImageViewerLocalizations.bundle in Resources */,
33625B75264D71130003310C /* lowResImage.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -330,6 +318,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -354,7 +343,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -385,6 +374,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -403,7 +393,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -418,7 +408,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = UYDA63C4EC;
INFOPLIST_FILE = BFRImageViewer/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.buffer.BFRImageViewer;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -432,7 +422,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = UYDA63C4EC;
INFOPLIST_FILE = BFRImageViewer/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.buffer.BFRImageViewer;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
32 changes: 1 addition & 31 deletions BFRImageViewerDemo/BFRImageViewer/FifthViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#import "FifthViewController.h"
#import "BFRImageViewController.h"

@interface FifthViewController () <UIViewControllerPreviewingDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate>
@interface FifthViewController () <UINavigationControllerDelegate, UIImagePickerControllerDelegate>

@end

Expand All @@ -28,39 +28,9 @@ - (instancetype) init {

- (void)viewDidLoad {
[super viewDidLoad];
[self check3DTouch];
[self addButtonsToView];
}

#pragma mark - 3D Touch

- (void)check3DTouch {
if ([self.traitCollection respondsToSelector:@selector(forceTouchCapability)] && self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable) {
[self registerForPreviewingWithDelegate:self sourceView:self.view];
}
}

- (UIViewController *)previewingContext:(id<UIViewControllerPreviewing>)previewingContext viewControllerForLocation:(CGPoint)location {
PHAuthorizationStatus status = [PHPhotoLibrary authorizationStatus];

if (status == PHAuthorizationStatusAuthorized) {
return [self imageViewControllerForLivePhotoDisableAutoplay:NO];
} else {
[self showAuthorizationAlertViewControllerAnimated:YES];
return nil;
}
}

- (void)previewingContext:(id<UIViewControllerPreviewing>)previewingContext commitViewController:(UIViewController *)viewControllerToCommit {
[self presentViewController:viewControllerToCommit animated:YES completion:nil];
}

- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection {
if ([self.traitCollection respondsToSelector:@selector(forceTouchCapability)] && self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable) {
[self check3DTouch];
}
}

#pragma mark - Misc

- (void)addButtonsToView {
Expand Down
24 changes: 1 addition & 23 deletions BFRImageViewerDemo/BFRImageViewer/FirstViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import "FirstViewController.h"
#import "BFRImageViewController.h"

@interface FirstViewController () <UIViewControllerPreviewingDelegate>
@interface FirstViewController ()
@property (strong, nonatomic) NSURL *imgURL;
@end

Expand All @@ -28,7 +28,6 @@ - (void)viewDidLoad {
[super viewDidLoad];

[self addImageButtonToView];
[self check3DTouch];

self.imgURL = [NSURL URLWithString:@"https://media0.giphy.com/media/huJmPXfeir5JlpPAx0/200.gif"];
}
Expand All @@ -39,27 +38,6 @@ - (void)openImage {
[self presentViewController:imageVC animated:YES completion:nil];
}

#pragma mark - 3D Touch
- (void)check3DTouch {
if ([self.traitCollection respondsToSelector:@selector(forceTouchCapability)] && self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable) {
[self registerForPreviewingWithDelegate:self sourceView:self.view];
}
}

- (UIViewController *)previewingContext:(id<UIViewControllerPreviewing>)previewingContext viewControllerForLocation:(CGPoint)location {
return [[BFRImageViewController alloc] initWithImageSource:@[self.imgURL]];
}

- (void)previewingContext:(id<UIViewControllerPreviewing>)previewingContext commitViewController:(UIViewController *)viewControllerToCommit {
[self presentViewController:viewControllerToCommit animated:YES completion:nil];
}

- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection {
if ([self.traitCollection respondsToSelector:@selector(forceTouchCapability)] && self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable) {
[self check3DTouch];
}
}

#pragma mark - Misc
- (void)addImageButtonToView {
UIButton *openImageFromURL = [UIButton buttonWithType:UIButtonTypeRoundedRect];
Expand Down
7 changes: 3 additions & 4 deletions BFRImageViewerDemo/BFRImageViewer/FourthViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,22 @@ - (void)viewDidLoad {
}

- (void)openImageViewer {
BFRBackLoadedImageSource *backloadedImage = [[BFRBackLoadedImageSource alloc] initWithInitialImage:[UIImage imageNamed:@"lowResImage"] hiResURL:[NSURL URLWithString:@"https://overflow.buffer.com/wp-content/uploads/2016/12/1-hByZ0VpJusdVwpZd-Z4-Zw.png"]];
BFRBackLoadedImageSource *backloadedImage = [[BFRBackLoadedImageSource alloc] initWithInitialImage:[UIImage imageNamed:@"lowResImage"] hiResURL:[NSURL URLWithString:@"https://images.unsplash.com/photo-1620910423680-80b93f872962?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1234&q=80"]];

BFRImageViewController *imageVC = [[BFRImageViewController alloc] initWithImageSource:@[backloadedImage]];
[self presentViewController:imageVC animated:YES completion:nil];
}

- (void)openImageViewerWithCompletionHandler {
BFRBackLoadedImageSource *backloadedImage = [[BFRBackLoadedImageSource alloc] initWithInitialImage:[UIImage imageNamed:@"lowResImage"] hiResURL:[NSURL URLWithString:@"https://overflow.buffer.com/wp-content/uploads/2016/12/1-hByZ0VpJusdVwpZd-Z4-Zw.png"]];
BFRBackLoadedImageSource *backloadedImage = [[BFRBackLoadedImageSource alloc] initWithInitialImage:[UIImage imageNamed:@"lowResImage"] hiResURL:[NSURL URLWithString:@"https://images.unsplash.com/photo-1620910423680-80b93f872962?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1234&q=80"]];

backloadedImage.onCompletion = ^(UIImage * _Nullable img, NSError * _Nullable error) {
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"Download Done" message:[NSString stringWithFormat:@"Finished downloading hi res image.\nImage:%@\nError:%@", img, error] preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction *close = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil];
[alertVC addAction:close];


UIViewController *topController = [UIApplication sharedApplication].keyWindow.rootViewController;
UIViewController *topController = self.view.window.windowScene.windows.firstObject.rootViewController;
while (topController.presentedViewController) {
topController = topController.presentedViewController;
}
Expand Down
Loading

0 comments on commit cc58637

Please sign in to comment.