Skip to content

Instantly share code, notes, and snippets.

@croossin
Created July 29, 2018 17:34
Show Gist options
  • Save croossin/0f6ea52beaab747ca4f7385ac7336b1d to your computer and use it in GitHub Desktop.
Save croossin/0f6ea52beaab747ca4f7385ac7336b1d to your computer and use it in GitHub Desktop.
class OverviewMintsightCardPartController: CardPartsViewController, MintsightTypeProtocol, NoTopBottomMarginsCardTrait {
override func viewDidLoad() {
super.viewDidLoad()
var cardParts: [CardPartView] = []
let title = CardPartTextView(type: .title)
viewModel.title.asObservable().bind(to: title.rx.text).disposed(by: bag) // This is where we are binding to the viewModel
title.textColor = brightFontColor
title.font = UIFont.mintGenericFontBlack(.large22)
title.textAlignment = .center
cardParts.append(title)
let description = CardPartTextView(type: .detail)
viewModel.description.asObservable().bind(to: description.rx.text).disposed(by: bag) // This is where we are binding to the viewModel
description.textColor = brightFontColor
description.font = UIFont.mintGenericFontSemibold(.normal)
description.textAlignment = .center
cardParts.append(description)
// ... and so on
setupCardParts(cardParts, forState: .hasData)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment