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 Foundation | |
import UIKit | |
// Usage Examples | |
let shadowColor = Color.shadow.value | |
let shadowColorWithAlpha = Color.shadow.withAlpha(0.5) | |
let customColorWithAlpha = Color.custom(hexString: "#123edd", alpha: 0.25).value | |
enum Color { | |
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 ViewControllerTest: XCTestCase { | |
var systemUnderTest: ViewController! | |
override func setUp() { | |
super.setUp() | |
//get the storyboard the ViewController under test is inside | |
let storyboard: UIStoryboard = UIStoryboard(name: "Main_iPhone", bundle: nil) |
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
// F#'s "pipe-forward" |> operator | |
// | |
// Also "Optional-chaining" operators |>! and |>& | |
// | |
// And adapters for standard library map/filter/sorted | |
infix operator |> { precedence 50 associativity left } | |
infix operator |>! { precedence 50 associativity left } | |
infix operator |>& { precedence 50 associativity left } | |
infix operator |>* { precedence 50 associativity left } |
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
CGRect headerTitleSubtitleFrame = CGRectMake(0, 0, 200, 44); | |
UIView* _headerTitleSubtitleView = [[[UILabel alloc] initWithFrame:headerTitleSubtitleFrame] autorelease]; | |
_headerTitleSubtitleView.backgroundColor = [UIColor clearColor]; | |
_headerTitleSubtitleView.autoresizesSubviews = YES; | |
CGRect titleFrame = CGRectMake(0, 2, 200, 24); | |
UILabel *titleView = [[[UILabel alloc] initWithFrame:titleFrame] autorelease]; | |
titleView.backgroundColor = [UIColor clearColor]; | |
titleView.font = [UIFont boldSystemFontOfSize:20]; | |
titleView.textAlignment = UITextAlignmentCenter; |