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
// | |
// Created by Alex Manarpies on 03/02/15. | |
// | |
#import <Foundation/Foundation.h> | |
#import <UIKit/UIKit.h> | |
@interface UILabel (AOTSizingUtilities) | |
- (void)aot_sizeToFitInWidth:(CGFloat)width; |
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
class SomeClass { | |
var someSubview:UIView = { | |
let v = UIView() | |
v.someProperty = "You want to initalize" | |
v.anotherProperty = "You may want to initialize" | |
return v | |
}() | |
} |
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 testCleanup() { | |
// Extend your class inline in order to add closure property `deinitCalled`, | |
// which indicates when/if your class's deinit() gets called | |
class ClassUnderTest: CLASS_YOU_WANT_TO_TEST { | |
var deinitCalled: (() -> Void)? | |
deinit { deinitCalled?() } | |
} | |
// Set up async expectation, which causes the test to wait for `deinitCalled` |
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
public protocol FileParser { | |
func parse(string: String) -> [Entry] | |
} | |
public struct FileParserFactory { | |
public static func unordered() -> FileParser { | |
UnorderedFileParser() | |
} | |
public static func ordered() -> FileParser { | |
LineOrderedFileParser(unorderedParser: unordered()) |
OlderNewer