Skip to content

Latest commit

 

History

History
67 lines (46 loc) · 1.46 KB

README.md

File metadata and controls

67 lines (46 loc) · 1.46 KB

PeselSwift logo

Build passing Swift 3.0 Carthage compatible

PeselSwift

Easy and lightweight library for Pesel (Polish National Identification Number) validation.

How to use

You can add framework to your project manually, or ...

add framework using Carthage:

github "lukszar/PeselSwift"

Examples

Below look at examples you can use in your app.

Validate Pesel

  let pesel = Pesel(pesel: "XXXXXXXXXXX")
  let result = pesel.validate()
        
  switch result {
    
    case .success:
      print("success")
            
    case .error(let error):
      print("failure with error: \(error)")
  }

or

  let result = Pesel.validate(pesel: "XXXXXXXXXXX")
        
  switch result {
    
    case .success:
      print("success")
            
    case .error(let error):
      print("failure with error: \(error)")
  }

Get birth date from pesel

let pesel = Pesel(pesel: "XXXXXXXXXXX")
let date = pesel.birthdate()
print(date)

App demo

Download demo app to see examples of usage.

Screenshot from application