Skip to content
This repository was archived by the owner on Sep 4, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions Alcatraz/Helpers/ATZDownloader.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

@interface ATZDownloader()
@property (strong, nonatomic) NSMutableDictionary *callbacks;
@property (strong, nonatomic) NSURLSession *urlSession;
@property (strong, nonatomic, readonly) NSURLSession *urlSession;
@end


Expand Down Expand Up @@ -135,16 +135,14 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task
#pragma mark - Private

- (NSURLSession *)urlSession {
if (_urlSession) return _urlSession;

_urlSession = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]
delegate:self
delegateQueue:[NSOperationQueue mainQueue]];
return _urlSession;
static dispatch_once_t onceToken;
static NSURLSession *session = nil;
dispatch_once(&onceToken, ^{
session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]
delegate:self
delegateQueue:[NSOperationQueue mainQueue]];
});
return session;
}





@end
1 change: 1 addition & 0 deletions Alcatraz/Helpers/ATZStyleKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ + (void)drawText:(NSString*)text withColor:(NSColor *)color centeredInRect:(NSRe
CGPathRef clippingPath = CGPathCreateWithRect(clippingRect, NULL);
CGContextAddPath(context, clippingPath);
CGContextClip(context);
CFRelease(clippingPath);

NSMutableParagraphStyle* textStyle = NSMutableParagraphStyle.defaultParagraphStyle.mutableCopy;
textStyle.alignment = NSCenterTextAlignment;
Expand Down