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
class FakeRecorder: BreadcrumbRecordable { | |
var testRecords: [Data] = [] | |
func saveRecord(_ data: Data!, streamName: String!) -> AWSTask<AnyObject>! { | |
testRecords.append(data) | |
return AWSTask() | |
} | |
func submitAllRecords() -> AWSTask<AnyObject>! { | |
return AWSTask() |
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 ReactiveKit | |
import UIKit | |
class UnderlinedTextField: UITextField { | |
@IBOutlet weak var underlineView: UIView! | |
override func awakeFromNib() { | |
super.awakeFromNib() | |
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 ReactiveKit | |
import UIKit | |
class ViewController: UIViewController { | |
// ... snip ... | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
viewModel.email.map { email in | |
return email?.address |
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
// | |
// UnderlinedTextField.swift | |
// Halo | |
// | |
// Created by Alan Fineberg on 7/25/17. | |
// | |
// | |
import Foundation | |
import ReactiveKit |
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 Foundation | |
import UIKit | |
@IBDesignable class GradientView: UIView { | |
let titleLabel = UILabel() | |
@IBInspectable var title: String? = nil { | |
didSet { | |
titleLabel.text = title |
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 Foundation | |
import ReactiveKit | |
import Bond | |
import UIKit | |
protocol SimpleAlertDelegate: class { | |
func didTapSecondaryButton(alertViewController: SimpleAlertViewController) | |
func didTapPrimaryButton(alertViewController: SimpleAlertViewController) | |
} |
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
class ExampleUsage: SimpleAlertDelegate { | |
private func configureRestPeriodAlert(lastStimulationTime: Date) -> SimpleAlertViewController { | |
let alertStoryboard = UIStoryboard(name: "Alert", bundle: Bundle.main) | |
guard let alertViewController = alertStoryboard.instantiateViewController(withIdentifier: "Alert") as? SimpleAlertViewController else { fatalError() } | |
alertViewController.modalTransitionStyle = .coverVertical | |
alertViewController.modalPresentationStyle = .overCurrentContext | |
let viewModel = SimpleAlertViewController.ViewModel() | |
viewModel.title.value = NSLocalizedString("RestPeriodAlertTitle", tableName: "", bundle: Bundle.main, value: "Rest Period", comment: "Title for alert which recommends waiting between Neuropriming sessions.") |