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 Bundle { | |
private final class _Internal { } | |
public static let framework = Bundle(for: _Internal.self) | |
} |
``` func tuple(text: String, property: MutableProperty) -> (String, MutableProperty) { return (text, property) } let sp = street.producer.map { (text: String) in return tuple(text, property: self.street) } var producers = [SignalProducer<(String, MutableProperty), NoError>]([]) producers.append(sp) ```
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 | |
public protocol MatrixProtocol { | |
var rows: Int {get } | |
var cols: Int { get } | |
typealias ElementType | |
var grid: [ElementType] { get set } | |
init(rows: Int, cols: Int) |
I hereby claim:
- I am kevinvitale on github.
- I am kevinvitale (https://keybase.io/kevinvitale) on keybase.
- I have a public key whose fingerprint is 1A36 B552 08B0 3C27 2F38 2446 CBE2 DA64 86BA 62F8
To claim this, I am signing this object:
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
//------------------------------------------------------------------------------ | |
// Source | |
id json = [@"Decimal" jsonFixture]; | |
NSArray *coord = json[@"coord"]; | |
NSLog(@"%@", coord); | |
//------------------------------------------------------------------------------ | |
// Output | |
2015-04-02 23:28:58.629 xctest[56318:2467238] ( | |
"16528.3", | |
"9940.17", |
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
// --- A note on all these 'willSet' stuff --- | |
// | |
// Upon initial creation: | |
// ◇ add as a child view controller (optional); | |
// ◇ add the child view controller's view to our own (optional); | |
// ◇ bind the frame to our own view's frame.size (required); | |
// - kvitale, 01/28/15 | |
// empty state | |
var emptyStateController: EmptyStateController! { |
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
func toInfusionSlots(infusionSlots: [JSON]?) -> [InfusionSlot]? { | |
if let infusionSlots = infusionSlots { | |
let map = { | |
(infusionSlot: JSON) -> InfusionSlot? | |
in | |
return InfusionSlot(infusionSlot); // failable — init?() | |
} | |
let filter = { | |
(infusionSlot: InfusionSlot?) -> Bool | |
in |
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
self.window!.rootViewController = { | |
() -> UINavigationController in | |
var viewController = UIViewController() | |
var navController = UINavigationController(rootViewController: viewController) | |
return navController | |
}() |
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 | |
@IBDesignable | |
class MyView: UIView { | |
@IBInspectable var fooColor: UIColor | |
init(frame: CGRect) { | |
super.init(frame: frame) | |
// Initialization code |
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 "KVNAppDelegate.h" | |
#import "UIWindow+ViewController.h" | |
#pragma mark - KVNAppDelegate | |
@implementation KVNAppDelegate | |
// ----------------------------------------------------------------------------- | |
// application:didFinishLaunchingWithOptions: | |
// ----------------------------------------------------------------------------- | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
self.window = [UIWindow windowWithRootViewController]; |