twitter / ios-twitter-network-layer Goto Github PK
View Code? Open in Web Editor NEWTwitter Network Layer is a scalable and feature rich network layer built on top of NSURLSession for Apple platforms
License: Apache License 2.0
Twitter Network Layer is a scalable and feature rich network layer built on top of NSURLSession for Apple platforms
License: Apache License 2.0
or not?
When this appear in CocoaPods, if plan exists.
There is a great deal of cleanup that can naturally occur by dropping iOS 7 support from the project. There aren't even any projects utilizing iOS 7, so it is a no-brainer :)
You did a great job and thank you for sharing!
๐
Well, I am a bit confused about your code style.
Well, it sometimes old, sometimes mis-conceptual, sometimes doesn't fit objective-c style.
For example:
// TNLSafeOperation
// NULL and nil are equivalent here, doesn't matter, of course.
// but in objective-c self.completionHandler = nil; is more appropriate
// [super setCompletionBlock:nil];
- (void)tnl_clearCompletionBlock
{
[super setCompletionBlock:NULL];
}
Moreover, you don't use auto type inference that cause a lot of boring reading.
Do not tell me that you build your apps with "not brand new xcode and bleeding-edge sdk".
So, bring new features of clang and llvm to your "codebase at the end of universe".
NSProcessInfo *processInfo = [NSProcessInfo processInfo];
will turn into
__auto_type processInfo = [NSProcessInfo processInfo];
Again, look at TNLSafeOperation static function in .m file.
For what reason you put static function here? Is it a C API? I do not see any invocation anywhere but in this file.
Oh, similar mistake to a lot of frameworks.
NSString * const TNLBackgroundRequestOperationDidCompleteNotification = @"TNLBackgroundRequestOperationDidCompleteNotification";
NSString * const TNLBackgroundRequestURLRequestKey = @"URLRequest";
NSString * const TNLBackgroundRequestResponseKey = @"response";
NSString * const TNLBackgroundRequestURLSessionConfigurationIdentifierKey = @"identifier";
NSString * const TNLBackgroundRequestURLSessionTaskIdentifierKey = @"taskIdentifier";
NSString * const TNLBackgroundRequestURLSessionSharedContainerIdentifierKey = @"sharedContainerIdentifier";
I don't want to see these keys, well, never.
I want to see a group of them like, for example, TNLBackgroundRequest__Keys.
@interface TNLBackgroundRequest__Keys : NSObject
+ (NSString *)OperationDidCompleteNotification;
+ (NSString *)URLRequestKey;
+ (NSString *)ResponseKey;
+ (NSString *)URLSessionConfigurationIdentifierKey;
+ (NSString *)URLSessionTaskIdentifierKey;
+ (NSString *)URLSessionSharedContainerIdentifierKey;
@end
Yes, I add additional interface that mimic string enums ( not really ) in "modern" swift.
Not really sure why you use static everywhere.
static dispatch_queue_t _URLSessionTaskOperationPropertyQueue(void);
static dispatch_queue_t _URLSessionTaskOperationPropertyQueue()
{
static dispatch_queue_t sQueue;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sQueue = dispatch_queue_create("TNLRequestOperation.URLSessionTaskOperation.atomic.queue", DISPATCH_QUEUE_CONCURRENT);
});
return sQueue;
}
Perfect place for them is @interface
with class methods.
Sometimes you use explicit obj == nil
and obj != nil
.
But when your demons come out, you prefer if (obj)
and if (!obj)
.
No code style at all?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.