We have FrontCard that contains number and expiration date, BackCard that contains CVC. CardView is used to contain front and back sides for flipping transition.
We leverage STPPaymentCardTextField from Stripe for working input fields, then CardHandler is used to parse STPPaymentCardTextField content and update our UI.
For masked credit card numbers, we pad string to fit 16 characters with ā symbol, then chunk into 4 parts and zip with labels to update.
For flipping animation, we use UIView.transition with showHideTransitionViews
We have FrontCard that contains number and expiration date, BackCard that contains CVC. CardView is used to contain front and back sides for flipping transition.
We leverage
STPPaymentCardTextField
from Stripe for working input fields, thenCardHandler
is used to parseSTPPaymentCardTextField
content and update our UI.For masked credit card numbers, we pad string to fit 16 characters with
ā
symbol, then chunk into 4 parts and zip with labels to update.For flipping animation, we use
UIView.transition
withshowHideTransitionViews
BackCard.swift
FrontCard.swift
CardView.swift
CardHandler.swift
String+Extension.swift