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
// Set a new `value` and a the `interpolatedSignal` will emit a number of values between our current `value` and the new `value`. | |
import Foundation | |
import ReactiveKit | |
class InterpolatedFloat { | |
private let bag = DisposeBag() | |
let interpolationPeriod: TimeInterval | |
let interpolationSteps: Int | |
private var oldValue: Float = 0.0 | |
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 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.") |
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 ReactiveKit | |
import Bond | |
import UIKit | |
protocol SimpleAlertDelegate: class { | |
func didTapSecondaryButton(alertViewController: SimpleAlertViewController) | |
func didTapPrimaryButton(alertViewController: SimpleAlertViewController) | |
} |
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 | |
@IBDesignable class GradientView: UIView { | |
let titleLabel = UILabel() | |
@IBInspectable var title: String? = nil { | |
didSet { | |
titleLabel.text = title |
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
// | |
// UnderlinedTextField.swift | |
// Halo | |
// | |
// Created by Alan Fineberg on 7/25/17. | |
// | |
// | |
import Foundation | |
import ReactiveKit |
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 ReactiveKit | |
import UIKit | |
class ViewController: UIViewController { | |
// ... snip ... | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
viewModel.email.map { email in | |
return email?.address |
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 ReactiveKit | |
import UIKit | |
class UnderlinedTextField: UITextField { | |
@IBOutlet weak var underlineView: UIView! | |
override func awakeFromNib() { | |
super.awakeFromNib() | |
NewerOlder