Validate Credit card number over your Application

In this tutorial i describe the how to validate the credit/debit card holder like (Master card,visa card etc).in the most cases every time call to server for checking the number rather then validate using implementation of  Luhn Algorithm for validating the card.

In that i implementing the Luhn Algorithm which describe further.

Below is the Logic for implementing the Validate card

Note:- In This Application their is no any kind of server call on the server just client side validation so don’t afraid about misuse of the credit card.


Now the starting the development for the validating the card.

1) Create New Project using (press cmd+shift+n). Select Single View Application.

2)Give the name of the project and select the location where to store.


3)  Now create the Adding New File Name as “CreditCardValidation”


4) Following code implement into “CreditCardValidation.h” file

5)  4) Following code implement into “CreditCardValidation.m” file


6) Now create the function for validate the card with describe below.This Function call in “EDIT CHANGE EVENT IN UITEXTFIELD”

Now When User Tap on Validate Button Following Method being Called.

Also Here is the some amount of Test numbers please  Visit  URL


Expected Output




Grab The Source Code From Here

One thought on “Validate Credit card number over your Application

  1. First of all Thanks for visit your blog.
    For new post update in blog there is one option for the subscriber where you insert your email address,
    After that when we update and new post that time you getting the mail in your mail address.

    Thanks for visits

Leave a Reply

Your email address will not be published. Required fields are marked *