This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface DFImageActivityItemProvider : UIActivityItemProvider | |
- (instancetype)initWithPlaceholderItem:(id)placeholderItem request:(DFImageRequest *)request; | |
@end | |
@implementation DFImageActivityItemProvider { | |
DFImageRequest *_request; | |
DFImageRequestID *_requestID; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DFCompositeImageTask.h | |
#import "DFImageManagerDefines.h" | |
#import <Foundation/Foundation.h> | |
#import <UIKit/UIKit.h> | |
@class DFCompositeImageTask; | |
@class DFImageRequest; | |
@class DFImageTask; | |
@protocol DFImageManaging; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DFProxyImageManager.h | |
#import "DFImageManaging.h" | |
#import "DFImageRequest.h" | |
#import <Foundation/Foundation.h> | |
/*! The DFProxyRequestTransforming protocol defines an interface for transforming application-specific classes or protocols to the resources supported by the DFImageManager. | |
*/ | |
@protocol DFProxyRequestTransforming <NSObject> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface ViewController : UIViewController | |
@property (nonatomic, readonly, nullable) UIView *keyboardAnchorView; | |
@property (nonatomic, readonly, nullable) NSLayoutConstraint *keyboardAnchorViewHeightConstraint; | |
@end | |
@implementation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import DFImageManager; | |
@interface CustomImageLoadingView | |
- (void)prepareForReuse; | |
- (void)setImageWithRequest:(nonnull DFImageRequest *)request; | |
@end | |
@implementation CustomImageLoadingView { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The MIT License (MIT) | |
// | |
// Copyright (c) 2015 Alexander Grebenyuk (github.com/kean). | |
import XCTest | |
import Foundation | |
extension XCTestCase { | |
public func expect(block: (fulfill: (Void) -> Void) -> Void) { | |
let expectation = self.expectation() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = ImageRequest(URLRequest: <#NSURLRequest#>) | |
request.targetSize = CGSize(width: 200, height: 200) // Resize image | |
request.processor = <#ImageProcessing#> // Apply image filters | |
Nuke.taskWithRequest(request) { response in | |
let image = response.image | |
}.resume() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
static const NSInteger GMAutoRetryControllerInfiniteAttemptCount = INT_MAX; | |
/*! Auto retry with progressive delay. Thread safe. | |
*/ | |
@interface GMAutoRetryController : NSObject | |
@property (nullable, nonatomic, copy) void (^block)(GMAutoRetryController *__nonnull autoRetryController); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "GMAutoRetryController.h" | |
#import "NSTimer+GMBlocks.h" | |
#import "NSError+Fitmeup.h" | |
#import "GMNetworkReachability.h" | |
#import "GMRepository.h" | |
typedef NS_ENUM(NSInteger, _GMARCState) { | |
_GMARCStateSuspended, // initial state |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)_fetchSomethingOrDieWithCompletion:(void (^)(id something))completion { | |
_autoRetryController = [[[GMURLAutoRetryController alloc] initWithBlock:^(GMAutoRetryController * _Nonnull controller) { | |
[/* start request with */ completion:^(id __nullable something, NSError * __nullable error) { | |
if (error) { | |
[controller scheduleAutoRetryWithError:error]; | |
} else { | |
completion(something); | |
} | |
}]; | |
}] resume]; |
OlderNewer