Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ’²[Native Checkout] Pledge button cell reuse bugfix #789

Merged
merged 4 commits into from Aug 9, 2019
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions Kickstarter-iOS/Views/RewardCardContainerView.swift
Expand Up @@ -86,15 +86,17 @@ public final class RewardCardContainerView: UIView {
}
self.pledgeButton.rac.enabled = self.viewModel.outputs.pledgeButtonEnabled

self.pledgeButton.rac.hidden = self.viewModel.outputs.pledgeButtonHidden

self.viewModel.outputs.pledgeButtonHidden.observeValues { [weak self] hidden in
guard let self = self else { return }

if hidden {
NSLayoutConstraint.activate(self.pledgeButtonHiddenConstraints)
NSLayoutConstraint.deactivate(self.pledgeButtonShownConstraints)
NSLayoutConstraint.activate(self.pledgeButtonHiddenConstraints)
} else {
NSLayoutConstraint.activate(self.pledgeButtonShownConstraints)
NSLayoutConstraint.deactivate(self.pledgeButtonHiddenConstraints)
NSLayoutConstraint.activate(self.pledgeButtonShownConstraints)
}
}

Expand Down