Skip to content

Instantly share code, notes, and snippets.

@alcamla
alcamla / AppDelegate.swift
Created May 30, 2018 21:39 — forked from jonathan-beebe/AppDelegate.swift
Detect if a Swift iOS app delegate is running unit tests
import UIKit
// Detect if the app is running unit tests.
// Note this only detects unit tests, not UI tests.
func isRunningUnitTests() -> Bool {
let env = NSProcessInfo.processInfo().environment
if let injectBundle = env["XCInjectBundle"] {
return NSString(string: injectBundle).pathExtension == "xctest"
}
return false
@alcamla
alcamla / introrx.md
Created January 11, 2018 14:41 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
#import <UIKit/UIKit.h>
@interface UIBezierPath (forEachElement)
- (void)forEachElement:(void (^)(CGPathElement const *element))block;
@end