Skip to content

Instantly share code, notes, and snippets.

@isaac-weisberg
Created April 17, 2021 10:28
Show Gist options
  • Save isaac-weisberg/0eeb7b717766c35162143f9501feb43d to your computer and use it in GitHub Desktop.
Save isaac-weisberg/0eeb7b717766c35162143f9501feb43d to your computer and use it in GitHub Desktop.
class TransactionCellView: UIView {
// ... other members omitted ...
let acceptButton = TransactionCellAcceptButton()
var iconToBottomConstraint: NSLayoutConstraint!
var acceptButtonToBottomConstraint: NSLayoutConstraint!
init(viewModel: TransactionCellViewModel) {
// ... omitted configuration of the view style ...
// ... omitted AutoLayout code ...
// ... omitted configuration of memembers ...
let shouldShowAcceptButton = viewModel.shouldShowAcceptButton
acceptButton.isHidden = !shouldShowAcceptButton
iconToBottomConstraint.isActive = !shouldShowAcceptButton
acceptButtonToBottomConstraint.isActive = shouldShowAcceptButton
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment