Skip to content

Instantly share code, notes, and snippets.

View alanf's full-sized avatar

Alan Fineberg alanf

View GitHub Profile
import UIKit
@IBDesignable class RoundedButton: UIButton {
// https://stackoverflow.com/questions/29618760/create-a-rectangle-with-just-two-rounded-corners-in-swift
override func awakeFromNib() {
super.awakeFromNib()
let roundedButtonFont = UIFont(name: "Montserrat-Bold", size: 14) ?? UIFont.boldSystemFont(ofSize: 14)
titleLabel?.font = roundedButtonFont
// 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