This file contains hidden or 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 UIKit | |
| // known-good: Swift 3 | |
| /** | |
| Abstract superclass for quickly defining a `UICollectionViewCell` subclass that wraps a | |
| specific `UIView` subclass. The resulting `UICollectionViewCell` will hug the wrapped view | |
| with layout constraints, so that both the cell and the wrapped view can influence | |
| each other's size via the normal Auto Layout mechanism. | |
| To use, override the class function `wrappedViewType` and the computed property | 
  
    
      This file contains hidden or 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
    
  
  
    
  | /** | |
| Adds views to containerView, along with constraints to stack them vertically | |
| and fill horozintally. | |
| */ | |
| func addVerticallyStackedViews(views:[UIView], toView containerView:UIView) -> [NSLayoutConstraint] | |
| { | |
| for v in views { | |
| v.setTranslatesAutoresizingMaskIntoConstraints(false) | |
| containerView.addSubview(v) | |
| } | 
  
    
      This file contains hidden or 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
    
  
  
    
  | /// Save image in an in-memory URL | |
| func toURL(image:UIImage) -> NSURL | |
| { | |
| let img = image | |
| let imgData:NSData = UIImagePNGRepresentation(img) | |
| let dataFormatString = "data:image/png;base64,%@" | |
| let dataString = String(format: dataFormatString, imgData.base64EncodedStringWithOptions(.allZeros)) | |
| let dataURL = NSURL(string: dataString)! | |
| return dataURL | |
| } | 
  
    
      This file contains hidden or 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
    
  
  
    
  | // swift 1.2 | |
| /** | |
| :param: old array of items | |
| :param: new array of items | |
| :return: a tuple where with the following components: | |
| - `newIndexesAdded` indexes in new, for elements that did not exist in old | |
| - `oldIndexesDeleted` indexes in old, for elements not in new | 
  
    
      This file contains hidden or 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
    
  
  
    
  | // known-good: Xcode 7.3 (Swift 2.2) | |
| import Cocoa | |
| private var rfc3339formatter:NSDateFormatter = { | |
| let formatter = NSDateFormatter() | |
| formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z" | |
| formatter.timeZone = NSTimeZone(forSecondsFromGMT: 0) | |
| formatter.calendar = NSCalendar(calendarIdentifier: NSCalendarIdentifierISO8601)! | |
| formatter.locale = NSLocale(localeIdentifier: "en_US_POSIX") | 
  
    
      This file contains hidden or 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
    
  
  
    
  | private extension NSURLComponents | |
| { | |
| func withQueryItem(name:String,intValue:Int) -> NSURLComponents { | |
| return self.withQueryItem(name, stringValue: NSNumber(integer: intValue).stringValue) | |
| } | |
| func withQueryItem(name:String,floatValue:Float) -> NSURLComponents { | |
| return self.withQueryItem(name, stringValue: NSNumber(float: floatValue).stringValue) | |
| } | |
  
    
      This file contains hidden or 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: generic networking and JSON-decoding helper | |
| // | |
| // give it a NSURLRequest and a session, it gives you back a aresult with an AnyObject or an NSError | |
| public class JSONService | |
| { | |
| /// returns JSON result on statusCode 200, and an error otherwise | |
| public class func taskWithJSONRequest( | 
  
    
      This file contains hidden or 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
    
  
  
    
  | // | |
| // NSString+RelativePaths.m | |
| #import "NSString+RelativePaths.h" | |
| /** | |
| Returns a path to resourcePath, relative to anchorPath. | |
  
    
      This file contains hidden or 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 hidden or 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
    
  
  
    
  | // ViewWrappingTableViewCell.swift | |
| // Created by Alexis Gallagher on 6/4/15. | |
| import UIKit | |
| /** | |
| Abstract superclass for quickly defining a `UITableViewCell` subclass that wraps a | |
| specific `UIView` subclass. The resulting `UITableViewCell` will hug the wrapped view | |
| with layout constraints, so that both the cell and the wrapped view can influence |