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
'use strict'; | |
var React = require('react-native'); | |
console.log('React:', React) | |
var { | |
View, | |
StyleSheet, | |
PanResponder, | |
Animated | |
} = React; |
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
### Stack | |
``` | |
CocoaPods : 0.37.2 | |
Ruby : ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15] | |
RubyGems : 2.0.14 | |
Host : Mac OS X 10.11 (15A204h) | |
Xcode : 7.0 (7A121l) | |
Git : git version 2.3.7 (Apple Git-57) | |
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib |
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
// Consider a generic class where `lhs` and `rhs` can be of any numeric type | |
struct Operation: Printable { | |
let lhs: Float | |
let rhs: Float | |
let `operator`: Operator | |
var description: String { | |
return "\(lhs) \(`operator`.symbol) \(rhs)" | |
} | |
} |
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 | |
extension UICollectionView { | |
// MARK: - Dequeue Nib Views | |
func dequeueNibView<T: UICollectionViewCell where T: ReuseIdentifierProtocol>(view: T.Type, indexPath: NSIndexPath) -> T { | |
return dequeueReusableCellWithReuseIdentifier(view.reuseIdentifier(), forIndexPath: indexPath) as T | |
} | |
func dequeueSupplementaryReusableNibView<T: UICollectionReusableView where T: ReuseIdentifierProtocol>(view: T.Type, kind: String, indexPath: NSIndexPath) -> T { |
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
#!/bin/sh | |
function set_base_flags() { | |
export GYP_GENERATORS="ninja" | |
export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0 libjingle_objc=1" | |
} | |
function set_base_ios_flags() { | |
set_base_flags |
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 Foundation | |
import Alamofire | |
import SwiftyJSON | |
typealias AlamofireResponseCompletion = (NSURLRequest, NSHTTPURLResponse?, AnyObject?, NSError?) -> Void | |
private let QueueIdentifier: String = "com.alamofire.Alamofire.SerializationQueue" | |
private let ErrorDomain: String = "com.alamofire.Alamofire.responseJSONSerializable" | |
// MARK: - Serializer for the API |
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 Foundation | |
import SwiftyJSON | |
typealias ObjectJSON = JSON | |
protocol JSONSerializable { | |
init(json: ObjectJSON) | |
} |
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
// | |
// FeedViewController.swift | |
// ProjectDemand | |
// | |
// Created by Justin Makaila on 1/13/15. | |
// Copyright (c) 2015 Present. All rights reserved. | |
// | |
import UIKit | |
import TableAdapter |
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 | |
extension UIView { | |
class func instantiateNibView<T: UIView where T: NibView>(type: T.Type) -> T { | |
return type.nib().instantiateWithOwner(nil, options: nil).first! as T | |
} | |
} |
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 | |
extension UITableView { | |
// MARK: - Dequeue Nib Views | |
func dequeueNibView<T: UITableViewCell where T: ReuseIdentifierProtocol>(view: T.Type) -> T { | |
return dequeueReusableCellWithIdentifier(view.reuseIdentifier()) as T | |
} | |