{"id":42837518,"url":"https://github.com/davidcvasquez/modelsettingssupport","last_synced_at":"2026-03-11T07:02:35.399Z","repository":{"id":335457748,"uuid":"1145804794","full_name":"davidcvasquez/ModelSettingsSupport","owner":"davidcvasquez","description":"Swift macros to generate type ID, name, and properties for model settings, suitable for registration as a ModelSettingPropertiesContainer and subsequent reference for UI layouts.","archived":false,"fork":false,"pushed_at":"2026-01-30T09:43:27.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-31T00:30:27.542Z","etag":null,"topics":["macros","swift","xcode"],"latest_commit_sha":null,"homepage":"https://davidcvasquez.github.io/ModelSettingsSupport/documentation/modelsettingssupport/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidcvasquez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-30T08:31:16.000Z","updated_at":"2026-01-30T23:29:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/davidcvasquez/ModelSettingsSupport","commit_stats":null,"previous_names":["davidcvasquez/modelsettingssupport"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/davidcvasquez/ModelSettingsSupport","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcvasquez%2FModelSettingsSupport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcvasquez%2FModelSettingsSupport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcvasquez%2FModelSettingsSupport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcvasquez%2FModelSettingsSupport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidcvasquez","download_url":"https://codeload.github.com/davidcvasquez/ModelSettingsSupport/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcvasquez%2FModelSettingsSupport/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30373511,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T06:09:32.197Z","status":"ssl_error","status_checked_at":"2026-03-11T06:09:17.086Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["macros","swift","xcode"],"created_at":"2026-01-30T11:45:57.769Z","updated_at":"2026-03-11T07:02:35.394Z","avatar_url":"https://github.com/davidcvasquez.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ModelSettingsSupport\n\n[![Swift](https://github.com/davidcvasquez/ModelSettingsSupport/actions/workflows/swift.yml/badge.svg)](https://github.com/davidcvasquez/ModelSettingsSupport/actions/workflows/swift.yml) [![codecov](https://codecov.io/gh/davidcvasquez/ModelSettingsSupport/graph/badge.svg?token=XB7T7FXO8B)](https://codecov.io/gh/davidcvasquez/ModelSettingsSupport)\n\nSwift macros to generate type, ID, and name metadata for properties used as model settings, suitable for registration as a `ModelSettingPropertiesContainer` and reference by a view model.\n\n## Details\n\n`ModelSettingsSupport` is built around two macros\\:\n\n- `@ModelSettingProperties`\n- `@ModelSettingID`\n\n## Usage\n\n```Swift\npublic extension UUIDBase58 {\n    static let testSettings: UUIDBase58 = \"5x9F8TcKRSosJzw9Ue9Rux\"\n    static let testSettingCustomFloatID: UUIDBase58 = \"w7JYs2KuWtVXuqxYA5Ta3X\"\n}\n\n@ModelSettingProperties(.testSettings)\npublic struct TestSettings {\n    @ModelSettingID(.testSettingCustomFloatID)\n    public var customFloat: NDFloat\n```\n\n## Minting ID values\n\nUse `UUIDBase58` as the format for CompactUUID.\n\nWe recommend using the `xcCompactUUID` Xcode Source Editor extension to mint new IDs directly in the source code editor.\n\nYou can also use the `compactuuid` command line interface (CLI) tool to generate these IDs with the default format.\n\n## Registration\n\nOnce a type has the @ModelSettingProperties and @ModelSettingID macros applied, conforming types can be registered as follows\\:\n\n```Swift\nfunc registerSettings(\n    for containerType: any ModelSettingPropertiesContainer.Type\n) {\n    print(\"Registered ModelSettingPropertiesContainer (name: \\(containerType.__name)), (id: \\(containerType.id)): \\(containerType.__modelSettingProperties)\")\n}\n```\n\nRegistrars of types can then access the type ID, name, and properties using the synthesized static members on the type\\:\n\n```Swift\npublic protocol StaticIdentifiable\u003cID\u003e {\n\n    /// A type representing the stable identity of the type.\n    associatedtype ID : Hashable\n\n    /// The stable identity of the type.\n    static var id: Self.ID { get }\n}\n\npublic protocol ModelSettingPropertiesContainer: StaticIdentifiable {\n    static var __name: String { get }\n    static var __modelSettingProperties: ModelSettingPropertiesMap\u003cTestSettings\u003e { get }\n}\n\npublic struct ModelSettingProperty {\n    public let id: UUIDBase58\n    public let name: String\n    public let valueSource: PropertyValueSource\n    public let access: PropertyAccessKind\n    public let valueKind: PropertyValueKind\n    public let mapEntry: PartialKeyPath\u003cModelSettingPropertiesType\u003e\n\n    public init(\n        id: UUIDBase58,\n        name: String,\n        valueSource: PropertyValueSource,\n        access: PropertyAccessKind,\n        valueKind: PropertyValueKind,\n        mapEntry: PartialKeyPath\u003cModelSettingPropertiesType\u003e\n    ) {\n        self.id = id\n        self.name = name\n        self.valueSource = valueSource\n        self.access = access\n        self.valueKind = valueKind\n        self.mapEntry = mapEntry\n    }\n}\n\npublic typealias ModelSettingPropertiesMap\u003cModelSettingPropertiesType\u003e =\n    OrderedDictionary\u003cUUIDBase58, ModelSettingProperty\u003cModelSettingPropertiesType\u003e\u003e\n\npublic enum PropertyValueSource: String {\n    case stored\n    case computed\n}\n\npublic enum PropertyAccessKind: String {\n    case readOnly\n    case readWrite\n}\n\npublic enum PropertyValueKind: CustomStringConvertible {\n    case bool\n    case int\n    case float\n    case cgFloat\n    case ndFloat\n    case angle\n    case ndAngle\n    case cgPoint\n    case ndPoint\n    case ndPolarPoint\n    case cgVector\n    case ndVector\n    case cgSize\n    case ndSize\n    case cgRect\n    case ndRect\n    case color\n    case cgColor\n    case text\n    case other(String)\n    // ...\n}\n```\n\n## Supported Versions\n\nThe minimum Swift version supported by ModelSettingsSupport is 5.9.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidcvasquez%2Fmodelsettingssupport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidcvasquez%2Fmodelsettingssupport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidcvasquez%2Fmodelsettingssupport/lists"}