/ Pin Code

Fully Customized pin code verification view without storyboard

Fully Customized pin code verification view without storyboard


Fully Customized pin code(OTP) verification view without storyboard.

Getting Started


  • Flawless focus change to the consecutive OTP box when the text is entered/deleted.
  • When the user taps on the Pinview, the first empty box available is focused automatically (when the cursor is hidden).
  • Customisations are available for pin box sizes, font color, border color, inputType etc.


download project for quick demo.

Manually :

  • Copy and drag the PHOTPView/ folder to your project.

How to Use?

  • create a PHOTPView object
var otpView: PHOTPView!

  • create a PinConfig object
var config : PinConfig = PinConfig()

responsible for all kind of customization


config.otpFieldDisplayType = .square
config.shouldAllowIntermediateEditing = false
config.otpFieldDefaultBorderColor = UIColor.blue
config.otpFieldEnteredBorderColor = UIColor.green
config.otpFieldErrorBorderColor = UIColor.red
  • initialize view by assigning cofig object
 otpView = PHOTPView(config: config)
 otpView.delegate = self
  • assign delegate
 otpView.delegate = self
  • Finally, Add to your view in which you want to configure OTPview
NOTE: Do not forget to initialize UI by calling below method.


  • xcode 9
  • swift 5