Email Validation Macro is a Swift macro framework for validating email addresses.
// Create and validate an email address
let validEmail = #email("[email protected]")
let invalidEmail = #email("[email protected]") // ❌
Add the following line to the dependencies in Package.swift
:
.package(
url: "https://github.com/josetorronteras/EmailValidationMacro",
from: "1.0.0"
),
Then add EmailValidationMacro
to your target's dependencies:
.product(
name: "EmailValidation",
package: "EmailValidationMacro"
),
Go to File > Add Package Dependencies...
and paste the repo's URL:
https://github.com/josetorronteras/EmailValidationMacro
This library is relased under the MIT license. See LICENSE for details.