This file contains hidden or 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
struct Order { | |
var itemPrices: [Int] | |
} | |
protocol OrderValidator { | |
func hasMinimumSpend(order: Order) -> Bool | |
} | |
class OrderViewModel { | |
This file contains hidden or 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
// use this in unit test target | |
class StubOrderValidator: OrderValidator { | |
var stubResponse: Bool! | |
func hasMinimumSpend(order: Order) -> Bool { | |
return self.stubResponse | |
} | |
} |
This file contains hidden or 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 | |
class ProgressBarView: UIView { | |
var progress: CGFloat = 0.0 { | |
didSet { | |
self.setNeedsDisplay() | |
} | |
} |
This file contains hidden or 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 | |
class MoveInOutViewController: UIViewController { | |
private weak var cardView: UIView! | |
private var cardViewHiddenConstraints: [NSLayoutConstraint]! | |
private var cardViewPresentConstraints: [NSLayoutConstraint]! | |
override func loadView() { | |
self.view = UIView() |
OlderNewer