- Introduction to Functional Programming Johannes Weiß - https://vimeo.com/100786088
- ReactiveCocoa at MobiDevDay Andrew Sardone - https://vimeo.com/65637501
- The Future Of ReactiveCocoa Justin Spahr-Summers - https://www.youtube.com/watch?v=ICNjRS2X8WM
- Enemy of the State Justin Spahr-Summers - https://www.youtube.com/watch?v=7AqXBuJOJkY
- WWDC 2014 Session 229 - Advanced iOS Application Architecture and Patterns Andy Matuschak - https://developer.apple.com/videos/play/wwdc2014/229/
- Functioning as a Functionalist Andy Matuschak - https://www.youtube.com/watch?v=rJosPrqBqrA
- Controlling Complexity in Swift Andy Matuschak - https://realm.io/news/andy-matuschak-controlling-complexity/
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 UIKit | |
let pixelDataByteSize = 4 | |
extension UIImage { | |
func getColor(pos: CGPoint) -> UIColor { | |
let imageData = CGDataProviderCopyData(CGImageGetDataProvider(self.CGImage)) | |
let data : UnsafePointer = CFDataGetBytePtr(imageData) |
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
// Very slightly adapted from http://stackoverflow.com/a/30141700/106244 | |
// 99.99% Credit to Martin R! | |
// Mapping from XML/HTML character entity reference to character | |
// From http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references | |
private let characterEntities : [String: Character] = [ | |
// XML predefined entities: | |
""" : "\"", | |
"&" : "&", |
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
struct DictionaryTwoWay<S:Hashable,T:Hashable> : DictionaryLiteralConvertible | |
{ | |
// Literal convertible | |
typealias Key = S | |
typealias Value = T | |
// Real storage | |
private var st : [S : T] = [:] | |
private var ts : [T : S] = [:] | |
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
if ([CLLocationManager locationServicesEnabled]) { | |
self.locationManager = [[CLLocationManager alloc] init]; | |
self.locationManager.delegate = self; | |
RACSignal *locationAuthorizationStatus = [[RACSignal | |
concat:@[ | |
[RACSignal return:@([CLLocationManager authorizationStatus])], | |
[[self rac_signalForSelector:@selector(locationManager:didChangeAuthorizationStatus:) fromProtocol:@protocol(CLLocationManagerDelegate)] map:^id(RACTuple *arguments) { | |
return arguments.second; | |
}] |
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
// didFinishLaunchingWithOptions or viewDidLoad: | |
locationManager = [[CLLocationManager alloc] init]; | |
locationManager.delegate = self; | |
locationManager.desiredAccuracy = kCLLocationAccuracyBest; | |
CLAuthorizationStatus status = [CLLocationManager authorizationStatus]; | |
NSLog(@"authorizationStatus: %d", status); | |
if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined && |
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 <UIKit/UIKit.h> | |
@class SomeViewController; | |
@protocol SomeViewControllerDelegate <NSObject> | |
-(void)delegateMethodName: (SomeViewController *) controller; | |
@end | |
@interface SomeViewController : UIViewController |
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
extension NSAttributedString { | |
func replaceHTMLTag(tag: String, withAttributes attributes: [String: AnyObject]) -> NSAttributedString { | |
let openTag = "<\(tag)>" | |
let closeTag = "</\(tag)>" | |
let resultingText: NSMutableAttributedString = self.mutableCopy() as NSMutableAttributedString | |
while true { | |
let plainString = resultingText.string as NSString | |
let openTagRange = plainString.rangeOfString(openTag) | |
if openTagRange.length == 0 { |
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
extension NSObject { | |
class var propertyNames: [String] { | |
get { | |
var count: UInt32 = 0 | |
let properties: UnsafeMutablePointer<objc_property_t> = class_copyPropertyList(self.classForCoder(), &count) | |
var propertyNames: [String] = [] | |
for i in 0..<count { | |
let property: objc_property_t = properties[Int(i)] | |
if let name = String(UTF8String: property_getName(property)) { | |
propertyNames += [name] |
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
// | |
// WIAccountTableViewController.m | |
// Wired In | |
// | |
// Created by Caleb Hicks on 7/17/14. | |
// Copyright (c) 2014 We Are Wired In. All rights reserved. | |
// | |
#import "WIAccountTableViewController.h" | |
#import <Parse/Parse.h> |