Code Monkey home page Code Monkey logo

Comments (8)

orazz avatar orazz commented on June 10, 2024

Demo 2

creditCardView.cardHolderString = "Name"

from creditcardform-ios.

cesarmtz93 avatar cesarmtz93 commented on June 10, 2024

i meant it to be in the capturing form, is that possible?

from creditcardform-ios.

orazz avatar orazz commented on June 10, 2024

@cesarmtz93 What do you mean by capturing?

from creditcardform-ios.

cesarmtzips93 avatar cesarmtzips93 commented on June 10, 2024

img_3165

Like this

from creditcardform-ios.

orazz avatar orazz commented on June 10, 2024

You can use your own textfield and set text manually.

from creditcardform-ios.

zahedul avatar zahedul commented on June 10, 2024

How to get cardName from card number ?

from creditcardform-ios.

AD-Paladins avatar AD-Paladins commented on June 10, 2024

You can use this code to create the card holder's field:

func createCardHolderTextField() {
    let y = paymentTextField.frame.origin.y + 99
    let cardHolderTextField = UITextField()
    cardHolderTextField.frame = CGRect(x: 15, y: y, width: self.view.frame.size.width - 30, height: 44)
    cardHolderTextField.delegate = self
    paymentTextField.translatesAutoresizingMaskIntoConstraints = false
    paymentTextField.borderWidth = 0
    
    let border = CALayer()
    let width = CGFloat(1.0)
    border.borderColor = UIColor.darkGray.cgColor
    border.frame = CGRect(x: 0, y: paymentTextField.frame.size.height - width, width:  paymentTextField.frame.size.width, height: paymentTextField.frame.size.height)
    border.borderWidth = width
    cardHolderTextField.layer.addSublayer(border)
    cardHolderTextField.layer.masksToBounds = true
    view.addSubview(cardHolderTextField)
    
    NSLayoutConstraint.activate([
        cardHolderTextField.topAnchor.constraint(equalTo: paymentTextField.bottomAnchor, constant: 20),
        cardHolderTextField.centerXAnchor.constraint(equalTo: view.centerXAnchor),
        cardHolderTextField.widthAnchor.constraint(equalToConstant: self.view.frame.size.width-20),
        cardHolderTextField.heightAnchor.constraint(equalToConstant: 44)
        ])
    
    cardHolderTextField.placeholder = "CARD HOLDER"
    
}

Dont forget to use the delegate methods in the viewController class

from creditcardform-ios.

Nomieee avatar Nomieee commented on June 10, 2024

creditCardView.cardHolderString = textField.text

for card Holder Name capture (User can enter Name in textField get Value in cardHolderString

from creditcardform-ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.