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
// | |
// ContextLabel.swift | |
// ContextLabel | |
// | |
// Created by Cory D. Wiles | |
// Copyright (c) 2017 Cory D. Wiles. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
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
//: Playground - noun: a place where people can play | |
import XCPlayground | |
import UIKit | |
// MARK: - Paragraph Styles | |
let headlineParagraphStyle = NSMutableParagraphStyle() | |
headlineParagraphStyle.lineHeightMultiple = 0.8 |
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
// | |
// MARK: Font utilities | |
// | |
enum FontFamily : String { | |
case HelveticaNeue = "Helvetica Neue" | |
case MontSerrat = "Montserrat" | |
} | |
enum FontWeight { |
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
// | |
// CommonMacros.h | |
// Created by Tom Adriaenssen (@inferis) | |
// Inspired by the awesome work by Piet Jaspers (@pjaspers) | |
// | |
/* | |
* How to use this file: | |
* 1. Find your .pch file | |
* 2. Import this file |
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 | |
import XCPlayground | |
XCPSetExecutionShouldContinueIndefinitely() | |
func getAllEmojis(completion: String? -> ()) { | |
let url = NSURL(string: "http://www.unicode.org/Public/UCD/latest/ucd/EmojiSources.txt")! | |
NSURLSession.sharedSession().dataTaskWithURL(url) { data, response, error in | |
guard let data = data where error == nil else { | |
completion(nil) |
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
@implementation NSURLConnection (Timeout) | |
+ (dispatch_queue_t)timeoutLockQueue { | |
static dispatch_queue_t queue; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
queue = dispatch_queue_create("timeout lock queue", DISPATCH_QUEUE_SERIAL); | |
}); | |
return queue; | |
} |
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 | |
enum CollectionOperator: String { | |
case avg | |
case count | |
case max | |
case min | |
case sum |
OlderNewer