This gist is the glue code for the pluggable downloader code to use Twitter Network Layer for iOS for networking in with Twitter Image Pipeline for iOS
TIP supports plugging in any network layer, so feel free to hack on this gist to your own needs.
static OSStatus WrapperSecTrustEvaluate(SecTrustRef serverTrust, SecTrustResultType *result) | |
{ | |
if (@available(iOS 13, *)) { | |
// SecTrustEvaluate is deprecated. | |
// Wrap new API to have same calling pattern as we had prior to deprecation. | |
// 1) call the new function to execut the evaluation | |
CFErrorRef error = NULL; | |
const bool evaluationSucceeded = SecTrustEvaluateWithError(serverTrust, &error); |
This gist is the glue code for the pluggable downloader code to use Twitter Network Layer for iOS for networking in with Twitter Image Pipeline for iOS
TIP supports plugging in any network layer, so feel free to hack on this gist to your own needs.
legacy = UIGraphicsBeginImageContextWithOptions
+ UIGraphicsEndImageContext
modern = UIGraphicsImageRendererFormat
+ UIGraphicsImageRenderer
prefersExtendedRange = NO
prefersExtendedRange = YES
@interface MyDebugCoder : NSCoder | |
+ (NSDictionary *)serializedJSONWithRootObject:(id<NSCoding, NSObject>)object; | |
@end | |
@implementation MyDebugCoder | |
{ | |
NSMutableDictionary *_jsonRoot; | |
NSMutableArray *_values; | |
} |
static size_t _CFRuntimeBaseGetSize() | |
{ | |
static size_t sSize = 0; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
// CFUUID has a very nice feature in that it's structure | |
// is always the CFRuntimeBase struct (which we don't have access to) | |
// followed by a UUID in bytes. | |
// By simply traversing the CFUUID structs byte layout until we find |