- ReactiveCocoa + ReactiveViewModel
- AFNetworking/Alamofire
- my Auto Layout debugging helpers
- my Swift-idiom macros: https://gist.github.com/cdzombak/93adfdc3f55c7f8299cd and weak/strong: https://gist.github.com/cdzombak/844e887ed4bdb933a905
- Underscore.m
- OHHTTPStubs
- Expecta
- OCMock
.gitignore
: Objc + Swift- If I need to deal with XML, Ono
// | |
// CDZIdioms.h | |
// https://www.dzombak.com/blog/2015/02/Tiny-Swift-idioms-in-ObjC.html | |
// | |
// Created by Chris Dzombak on 3/21/15. | |
// Copyright (c) 2015 Chris Dzombak. All rights reserved. | |
// | |
#ifndef CDZIdioms_h | |
#define CDZIdioms_h |
#import <Foundation/Foundation.h> | |
#define lazy_get(TYPE, NAME, VALUE) \ | |
@synthesize NAME = _##NAME; \ | |
- (TYPE)NAME { if (!_##NAME) _##NAME = (VALUE); return _##NAME; } | |
// example usage follows: | |
@interface LazyThing : NSObject |
#import <Foundation/Foundation.h> | |
#define as_checked(EXPR, KLASS) ({ id _obj = EXPR; NSCAssert([_obj isKindOfClass:[KLASS class]], @"Cannot cast %@ to %@", NSStringFromClass([_obj class]), NSStringFromClass([KLASS class])); _obj; }) | |
#define as_option(EXPR, KLASS) ({ id _obj = EXPR; if (![_obj isKindOfClass:[KLASS class]]) _obj = nil; _obj; }) | |
@interface NSObject(As) | |
- (instancetype)asChecked:(Class)klass; |
#import <Foundation/Foundation.h> | |
#define iflet(LHS, RHS) \ | |
for (id obj_ = (RHS); obj_ != nil;) \ | |
for (LHS = (obj_ ?: (RHS)); obj_ != nil; obj_ = nil) | |
int main(int argc, char *argv[]) { | |
@autoreleasepool { | |
NSString *x = nil; | |
NSString *y = @"y"; |
You have a lot of responsibilities and plenty of to-dos to keep track of. Add in your email and Instapaper and it can feel impossible to make any progress. But it's not! In this talk we’ll discuss basic principles you can use to organize yourself, stay atop your responsibilities, and destress at the same time. We’ll also cover some common organizational pitfalls that we as programmers can fall into, and we’ll briefly discuss tooling, including the pros and cons of using a tool like OmniFocus.
public class Router : NSObject { | |
typealias VCPushBlock = (UIViewController) -> (Void) | |
init(context: NSManagedObjectContext, pushBlock: VCPushBlock) { | |
// ... | |
} | |
convenience init(context: NSManagedObjectContext, owningViewController: UIViewController) { | |
self.init(context: context, pushBlock: { | |
owningViewController.navigationController?.pushViewController($0, animated: true) |
public class Router : NSObject { | |
typealias VCPushBlock = (UIViewController) -> (Void) | |
init(context: NSManagedObjectContext, pushBlock: VCPushBlock) { | |
// ... | |
} | |
convenience init(context: NSManagedObjectContext, owningViewController: UIViewController) { | |
self.init(context: context, pushBlock: { | |
owningViewController.navigationController?.pushViewController($0, animated: true) |
-
Barring serious fundamental crypto breakthroughs, it's not technically possible to introduce a back door for law enforcement without putting the users at risk. Any back door (or "front door," which isn't a real thing in cryptosystem design) represents an additional attack vector. For example, a hypothetical key store for an encrypted messaging service, even if designed to be used only after due process is applied, represents a huge risk to all users of the system, from other nation-states or other organizations.
-
More importantly in real-world scenarios, these encrypted messages will be around forever, and "due process" is malleable. In early-2000s America, one can imagine a suspension of due process in the investigation of a major terrorist attack or other act of war; in other countries, due process is redefined or taken away after a regime change. Then every message sent by anyone who has ever used the system is vulnerable.
override func loadView() { | |
let webView = UIWebView() | |
webView.delegate = self | |
webView.backgroundColor = UIColor.nl_offWhite() | |
view = webView | |
} | |
// vs. |