defaults write com.apple.iphonesimulator AllowFullscreenMode -bool YES
View RealmFileLocation.md
po Realm.Configuration.defaultConfiguration.fileURL
View Singleton.swift
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
final class Singleton { | |
static let shared = Singleton() | |
private init() {} | |
} |
View prettyJSON.swift
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
print(String(data: try! JSONSerialization.data(withJSONObject: dict, options: .prettyPrinted), encoding: .utf8)!) |
View snippet
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
git merge v1.0 --no-commit --no-ff |
View AppDelegate.swift
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 | |
// 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 |
View introrx.md
The introduction to Reactive Programming you've been missing
(by @andrestaltz)
This tutorial as a series of videos
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
View UIBezierPath+forEachElement.h
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> | |
@interface UIBezierPath (forEachElement) | |
- (void)forEachElement:(void (^)(CGPathElement const *element))block; | |
@end |