Spritz is an Italian tax code (codice fiscale) generator and validator on steroids written in Swift.
It offers anything from simple regex validator, to complex analysis using the user's information, taking into account the omocodia phenomenon.
The library is fully tested and documented.
| Swift | Spritz | iOS | 
|---|---|---|
| 5.1+ | 1.0.x | 10+ | 
| 5.3+ | 2.0.x | 10+ | 
Open your Package.swift file and add the following as your dependency.
dependencies: [
  .package(url: "https://github.com/TheInkedEngineer/Spritz", from: "2.0.0")
]Then add the following to your target's dependency:
targets: [
  .target(
    name: "MyTarget", 
    dependencies: [
      .product(name: "https://github.com/TheInkedEngineer/Spritz", package: "Spritz")
    ]
  )
]- Open your app in Xcode
 - In the Project Navigator, click on the project
 - in the Project panel, click on the project
 - Go to the Package Dependencies tab
 - Click on the 
+button - Insert the 
https://github.com/TheInkedEngineer/Spritzurl in the search bar and press Enter - Click on the 
Add Packagebutton - Follow the Xcode's dialog to install the SDK
 
Spritz is fully documented. Checkout the documentation here.
let data = Spritz.Models.CodiceFiscaleData(
  firstName: "First",
  lastName: "last",
  dateOfBirth: Spritz.Models.Date(day: 2, month: .april, year: 1987)!,
  sex: .female,
  placeOfBirth: .foreign(countryName: "francia")
)
let codice = try? Spritz.generateCF(from: data)let result = Spritz.isValid("LSTFST89B44B354F")let data = Spritz.Models.CodiceFiscaleData(
  firstName: "First",
  lastName: "last",
  dateOfBirth: Spritz.Models.Date(day: 2, month: .april, year: 1987)!,
  sex: .female,
  placeOfBirth: .foreign(countryName: "francia")
)
    
let result = Spritz.isCorrect(fiscalCode: "LSTFST89B44B354F", for: data)Working on your first Pull Request? You can learn how from this free series How to Contribute to an Open Source Project on GitHub
