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] Credit card cell #766

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Kickstarter-iOS/Views/Cells/PledgeCreditCardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,34 +77,34 @@ final class PledgeCreditCardView: UIView {
super.bindStyles()

_ = self
|> viewStyle
|> self.viewStyle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm why did it add self here? These styles should live outside the class, private to the file. πŸ€”


_ = self.selectButton
|> selectButtonStyle
|> self.selectButtonStyle

_ = self.selectButton.titleLabel
?|> selectButtonTitleLabelStyle
?|> self.selectButtonTitleLabelStyle

_ = self.imageView
|> imageViewStyle
|> self.imageViewStyle

_ = self.lastFourLabel
|> lastFourLabelStyle
|> self.lastFourLabelStyle

_ = self.expirationDateLabel
|> expirationDateLabelStyle
|> self.expirationDateLabelStyle

_ = self.labelsStackView
|> labelsStackViewStyle
|> self.labelsStackViewStyle

_ = self.adaptableStackView
|> checkoutAdaptableStackViewStyle(
self.traitCollection.preferredContentSizeCategory.isAccessibilityCategory
)
|> adaptableStackViewStyle
|> self.adaptableStackViewStyle

_ = self.rootStackView
|> rootStackViewStyle
|> self.rootStackViewStyle
}

override func bindViewModel() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ final class PledgePaymentMethodsViewController: UIViewController {
private lazy var scrollViewHeightConstraint: NSLayoutConstraint = {
self.scrollView.heightAnchor.constraint(equalToConstant: 0)
}()

private lazy var spacer: UIView = { UIView(frame: .zero) }()
private lazy var titleLabel: UILabel = { UILabel(frame: .zero) }()

Expand Down Expand Up @@ -50,8 +51,8 @@ final class PledgePaymentMethodsViewController: UIViewController {
private func setupConstraints() {
NSLayoutConstraint.activate([
self.scrollViewHeightConstraint,
self.applePayButton.heightAnchor.constraint(greaterThanOrEqualToConstant: Styles.minTouchSize.height)
])
self.applePayButton.heightAnchor.constraint(greaterThanOrEqualToConstant: Styles.minTouchSize.height)
])
}

override func viewDidLayoutSubviews() {
Expand All @@ -74,19 +75,19 @@ final class PledgePaymentMethodsViewController: UIViewController {
|> checkoutBackgroundStyle

_ = self.cardsStackView
|> cardsStackViewStyle
|> self.cardsStackViewStyle

_ = self.applePayButton
|> applePayButtonStyle
|> self.applePayButtonStyle

_ = self.scrollView
|> checkoutBackgroundStyle

_ = self.rootStackView
|> rootStackViewStyle
|> self.rootStackViewStyle

_ = self.titleLabel
|> titleLabelStyle
|> self.titleLabelStyle
}

// MARK: - View model
Expand Down
1 change: 0 additions & 1 deletion Library/CreditCard+UtilsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import Prelude
import XCTest

final class CreditCard_UtilsTests: XCTestCase {

func testExpirationDate() {
let card = GraphUserCreditCard.masterCard
|> \.expirationDate .~ "2019-09-20"
Expand Down