{"id":27786209,"url":"https://github.com/fluidgroup/swiftui-functional-component-macro","last_synced_at":"2025-10-29T17:04:19.047Z","repository":{"id":286626762,"uuid":"962008298","full_name":"FluidGroup/swiftui-functional-component-macro","owner":"FluidGroup","description":"A Swift macro library that enables to make SwiftUI stateful component from function declaration","archived":false,"fork":false,"pushed_at":"2025-04-08T02:27:56.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-08T03:28:47.076Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/FluidGroup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-07T14:04:20.000Z","updated_at":"2025-04-08T02:27:59.000Z","dependencies_parsed_at":"2025-04-07T15:34:12.655Z","dependency_job_id":null,"html_url":"https://github.com/FluidGroup/swiftui-functional-component-macro","commit_stats":null,"previous_names":["fluidgroup/swiftui-functional-component","fluidgroup/swiftui-functional-component-macro"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluidGroup%2Fswiftui-functional-component-macro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluidGroup%2Fswiftui-functional-component-macro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluidGroup%2Fswiftui-functional-component-macro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluidGroup%2Fswiftui-functional-component-macro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FluidGroup","download_url":"https://codeload.github.com/FluidGroup/swiftui-functional-component-macro/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251737578,"owners_count":21635624,"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":[],"created_at":"2025-04-30T15:58:02.719Z","updated_at":"2025-10-29T17:04:18.968Z","avatar_url":"https://github.com/FluidGroup.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# swiftui-functional-component\n\nA Swift macro library that enables to make SwiftUI stateful component from function declaration. It automatically converts a function with parameters into a SwiftUI View struct with proper state management (@State, @Binding) and initialization.\n\n## Overview\n\n```swift\n@ViewComponent\nfunc hoge(arg1: Int, arg2: String, arg3: @escaping () -\u003e Void) -\u003e some View {\n  \n  @State var count: Int = 0\n  \n  VStack {\n    Text(\"\\(count), \\(arg1), \\(arg2)\")\n    Button(\"Click me\") {\n      count += 1\n    }\n  }\n    \n}\n```\n\nMacro expands above into this:\n\n```swift\nfunc hoge(arg1: Int, arg2: String, arg3: @escaping () -\u003e Void) -\u003e some View {\n  struct Component: View {\n    \n    let arg1: Int\n    let arg2: String\n    let arg3: () -\u003e Void\n    @State var count: Int = 0\n    \n    init(arg1: Int, arg2: String, arg3: @escaping () -\u003e Void) {\n      self.arg1 = arg1\n      self.arg2 = arg2\n      self.arg3 = arg3\n    }\n                  \n    var body: some View {\n      VStack {\n          Text(\"\\(count), \\(arg1), \\(arg2)\")\n          Button(\"Click me\") {\n            count += 1\n          }\n        }\n    }\n              \n  }                  \n  return Component(arg1: arg1, arg2: arg2, arg3: arg3)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluidgroup%2Fswiftui-functional-component-macro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluidgroup%2Fswiftui-functional-component-macro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluidgroup%2Fswiftui-functional-component-macro/lists"}