This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// LocaleIdentifiers.swift | |
// Xcode Playgrounds | |
// | |
// Created: Guillem Servera Negre on 21/04/2017. | |
// Copyright: Public domain. | |
// | |
import Foundation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
/** | |
Valida el número y la(s) letra(s) de un cualquier documento nacional de identidad | |
español (NIF o NIE) utilizando una implementación del algoritmo oficial. | |
- parameter nationalID: El DNI que se validará. No distingue mayúsculas y minúsculas. | |
- returns: `true` si el DNI proporcionado es válido o `false` si no lo es. | |
*/ | |
func validateSpanishNationalIdentifier(nationalID: String) -> Bool { | |
guard nationalID.characters.count == 9 else { |