{"id":19098157,"url":"https://github.com/fsaldivar-dev/experimental-annotation-swift","last_synced_at":"2025-06-24T13:05:00.844Z","repository":{"id":50714109,"uuid":"391455559","full_name":"fsaldivar-dev/experimental-annotation-swift","owner":"fsaldivar-dev","description":"El objetivo del repositorio es poder usar un conjunto de anotaciones \"property wrappers\" a un atributo.","archived":false,"fork":false,"pushed_at":"2022-08-03T12:24:42.000Z","size":294,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-03-15T02:45:58.222Z","etag":null,"topics":["ios-app","ios-swift","property-wrapper","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fsaldivar-dev.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-31T20:14:34.000Z","updated_at":"2022-08-02T16:42:56.000Z","dependencies_parsed_at":"2022-08-22T11:50:42.977Z","dependency_job_id":null,"html_url":"https://github.com/fsaldivar-dev/experimental-annotation-swift","commit_stats":null,"previous_names":["javiersaldivarrubio/experimental-annotation-swift"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsaldivar-dev%2Fexperimental-annotation-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsaldivar-dev%2Fexperimental-annotation-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsaldivar-dev%2Fexperimental-annotation-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsaldivar-dev%2Fexperimental-annotation-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fsaldivar-dev","download_url":"https://codeload.github.com/fsaldivar-dev/experimental-annotation-swift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240152018,"owners_count":19756011,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ios-app","ios-swift","property-wrapper","swift"],"created_at":"2024-11-09T03:44:20.981Z","updated_at":"2025-02-22T09:24:00.943Z","avatar_url":"https://github.com/fsaldivar-dev.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# experimental-annotation-swift\n\n\u003cimg width=\"480\" alt=\"AnnotationSwift\" src=\"https://user-images.githubusercontent.com/16517868/182271709-188b8cfb-1ac7-4e8e-b062-b3ee121bd92f.png\"\u003e\n\n\n![GitHub issues:\tGitHub issues badge](https://img.shields.io/github/issues/fsaldivar-dev/experimental-annotation-swift)\n![GitHub forks:\tGitHub forks badge](https://img.shields.io/github/forks/fsaldivar-dev/experimental-annotation-swift)\n[![GitHub stars](https://img.shields.io/github/stars/fsaldivar-dev/experimental-annotation-swift?style=for-the-badge)](https://github.com/fsaldivar-dev/experimental-annotation-swift/stargazers)\n\n![GitHub license:\tGitHub license badge](https://img.shields.io/github/license/fsaldivar-dev/experimental-annotation-swift)\n![Cocoapods](https://img.shields.io/cocoapods/v/AnnotationSwift)\n[![Build](https://github.com/fsaldivar-dev/experimental-annotation-swift/actions/workflows/Build.yml/badge.svg)](https://github.com/fsaldivar-dev/experimental-annotation-swift/actions/workflows/Build.yml)\n[![Test](https://github.com/fsaldivar-dev/experimental-annotation-swift/actions/workflows/UnitTest.yml/badge.svg)](https://github.com/fsaldivar-dev/experimental-annotation-swift/actions/workflows/UnitTest.yml)\n\n# Coverage\nTotal Coverage: \u003cb\u003e92.39%\u003c/b\u003e\n\n\u003cdetails\u003e\u003csummary\u003eCoverage Report\u003c/summary\u003e\u003ctable\u003e\u003ctbody\u003e\u003ctr\u003e\u003cth\u003eFile\u003c/th\u003e\u003cth\u003eBranches\u003c/th\u003e\u003cth\u003eFuncs\u003c/th\u003e\u003cth\u003eLines\u003c/th\u003e\u003cth\u003eUncovered Lines\u003c/th\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd colspan='5'\u003e\u003cb\u003eSources\u003c/b\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u0026nbsp; \u0026nbsp;\u003ca href='https://github.com/fsaldivar-dev/experimental-annotation-swift/blob/undefined/Sources/experimental_annotation.swift'\u003eexperimental_annotation.swift\u003c/a\u003e\u003c/td\u003e\u003ctd\u003e100%\u003c/td\u003e\u003ctd\u003e\u003cb\u003e75%\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e78.57%\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003ca href='https://github.com/fsaldivar-dev/experimental-annotation-swift/blob/undefined/Sources/experimental_annotation.swift#L15'\u003e15\u003c/a\u003e, \u003ca href='https://github.com/fsaldivar-dev/experimental-annotation-swift/blob/undefined/Sources/experimental_annotation.swift#L16'\u003e16\u003c/a\u003e, \u003ca href='https://github.com/fsaldivar-dev/experimental-annotation-swift/blob/undefined/Sources/experimental_annotation.swift#L17'\u003e17\u003c/a\u003e, \u003ca href='https://github.com/fsaldivar-dev/experimental-annotation-swift/blob/undefined/Sources/experimental_annotation.swift#L19'\u003e19\u003c/a\u003e, \u003ca href='https://github.com/fsaldivar-dev/experimental-annotation-swift/blob/undefined/Sources/experimental_annotation.swift#L20'\u003e20\u003c/a\u003e, \u003ca href='https://github.com/fsaldivar-dev/experimental-annotation-swift/blob/undefined/Sources/experimental_annotation.swift#L21'\u003e21\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd colspan='5'\u003e\u003cb\u003eSources/annotations\u003c/b\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u0026nbsp; \u0026nbsp;\u003ca href='https://github.com/fsaldivar-dev/experimental-annotation-swift/blob/undefined/Sources/annotations/EmailAnnotation.swift'\u003eEmailAnnotation.swift\u003c/a\u003e\u003c/td\u003e\u003ctd\u003e100%\u003c/td\u003e\u003ctd\u003e100%\u003c/td\u003e\u003ctd\u003e100%\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u0026nbsp; \u0026nbsp;\u003ca href='https://github.com/fsaldivar-dev/experimental-annotation-swift/blob/undefined/Sources/annotations/LengthAnnotation.swift'\u003eLengthAnnotation.swift\u003c/a\u003e\u003c/td\u003e\u003ctd\u003e100%\u003c/td\u003e\u003ctd\u003e100%\u003c/td\u003e\u003ctd\u003e100%\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u0026nbsp; \u0026nbsp;\u003ca href='https://github.com/fsaldivar-dev/experimental-annotation-swift/blob/undefined/Sources/annotations/LowCaseAnnotation.swift'\u003eLowCaseAnnotation.swift\u003c/a\u003e\u003c/td\u003e\u003ctd\u003e100%\u003c/td\u003e\u003ctd\u003e\u003cb\u003e75%\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e90.91%\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003ca href='https://github.com/fsaldivar-dev/experimental-annotation-swift/blob/undefined/Sources/annotations/LowCaseAnnotation.swift#L20'\u003e20\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/details\u003e\nLibrería que se usa para anidar anotaciones\n\n# Roadmap\n\n| Roadmap | Estado |\n| ------------- | ------------- |\n| Crear código base | :white_check_mark: |\n| SwiftPackage | :white_check_mark: |\n| [CocoaPods](https://cocoapods.org) | :white_check_mark: |\n| Example | :white_check_mark: |\n| UnitTest | :white_check_mark: |\n| [Documentación](https://fsaldivar-dev.github.io/experimental-annotation-swift/documentation/annotationswift/)  | :rocket:  |\n| Extensiones  | [ ]  |\n\n\n### Swift Package Manager\nSwift Package Manager es una herramienta para automatizar la distribución de código Swift y está integrado en el compilador Swift. Está en desarrollo temprano, pero experimental-annotation-swift admite su uso en plataformas compatibles.\n\n\nUna vez que haya configurado su paquete Swift, agregar experimental-annotation-swift como dependencia es tan fácil como agregarlo al valor de dependencias de su Package.swift.\n```swift\ndependencies: [\n    .package(url: \"https://github.com/JavierSaldivarRubio/esperimental-annotation-swift\", .upToNextMajor(from: \"0.0.1\"))\n]\n```\n\n### CocoaPods\n[CocoaPods](https://cocoapods.org) es un administrador de dependencias para proyectos Cocoa. Para obtener instrucciones de uso e instalación, visite su sitio web. Para integrar AnnotationSwift en su proyecto Xcode usando CocoaPods, especifíquelo en su `Podfile`:\n\n\n```ruby\npod 'AnnotationSwift'\n```\n\n\n\n### Teoría\nEn java se conoce ya desde hace mucho tiempo las funciones denominadas anotaciones las cuales son muy comunes en sprint, o al usar la serialización con gson en android, en iOS no existía si no hace pocos años el uso de [**property wrappers**](https://docs.swift.org/swift-book/LanguageGuide/Properties.html#ID617)\n\n\nSi bien es muy similar a las anotaciones de java, aun son muy simples y su principal limitante es que no se puede usar más de una anotación en una variable, \n\n\n```swift\n@Upercase\n@MaxLenght(10) //(X) Error Property type 'String?' does not match that of the 'wrappedValue' property of its wrapper type 'Email'\nvar name: String?\n```\nla intención de esta librería es poder crear grupos de annotaciones para cualquier fin.\n Ejemplo:\n```swift\n\nstruct Model {\n    @GroupSet(Email\u003cString\u003e(),\n              LowCase\u003cString\u003e())\n    var email: String?\n    @GroupSet(MinLength\u003cString\u003e(minLength: 3),\n              MaxLength\u003cString\u003e(maxLength: 10))\n      var min3Max10: String?\n}\n````\nSe puede observar un modelo donde al attributo `email` se le agregan dos restricciones, la primera es que se requiere ser de tipo *email*, la segunda es que necesita que el string sea minusculas, si yo agrego `FSALDIVAR_DEV@example.com` el valor sera cambiado por `fsaldivar_dev@example.com`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffsaldivar-dev%2Fexperimental-annotation-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffsaldivar-dev%2Fexperimental-annotation-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffsaldivar-dev%2Fexperimental-annotation-swift/lists"}