defaults write com.apple.iphonesimulator AllowFullscreenMode -bool YES
po Realm.Configuration.defaultConfiguration.fileURL
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() {} | |
} |
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)!) |
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 |
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 |
(by @andrestaltz)
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.
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 |