{"id":1271,"url":"https://github.com/joshaber/SwiftBox","last_synced_at":"2025-07-30T20:32:59.416Z","repository":{"id":26709338,"uuid":"30166546","full_name":"joshaber/SwiftBox","owner":"joshaber","description":"Flexbox in Swift, using Facebook's css-layout.","archived":false,"fork":false,"pushed_at":"2017-01-23T09:29:16.000Z","size":111,"stargazers_count":810,"open_issues_count":6,"forks_count":57,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-07-29T18:53:39.920Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joshaber.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}},"created_at":"2015-02-02T01:42:30.000Z","updated_at":"2025-07-21T13:47:18.000Z","dependencies_parsed_at":"2022-09-01T03:12:59.194Z","dependency_job_id":null,"html_url":"https://github.com/joshaber/SwiftBox","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/joshaber/SwiftBox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshaber%2FSwiftBox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshaber%2FSwiftBox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshaber%2FSwiftBox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshaber%2FSwiftBox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshaber","download_url":"https://codeload.github.com/joshaber/SwiftBox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshaber%2FSwiftBox/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267746555,"owners_count":24138000,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-01-05T20:15:42.645Z","updated_at":"2025-07-30T20:32:58.985Z","avatar_url":"https://github.com/joshaber.png","language":"Swift","funding_links":[],"categories":["Layout","Swift","Libs"],"sub_categories":["Other Hardware","Other free courses","Layout"],"readme":"# SwiftBox\n\nA Swift wrapper around Facebook's [implementation](https://github.com/facebook/css-layout) of CSS's flexbox.\n\n## Example\n\n```swift\nlet parent = Node(size: CGSize(width: 300, height: 300),\n                  childAlignment: .Center,\n                  direction: .Row,\n                  children: [\n    Node(flex: 75,\n         margin: Edges(left: 10, right: 10),\n         size: CGSize(width: 0, height: 100)), \n    Node(flex: 15,\n         margin: Edges(right: 10),\n         size: CGSize(width: 0, height: 50)),\n    Node(flex: 10,\n         margin: Edges(right: 10),\n         size: CGSize(width: 0, height: 180)),\n])\n\nlet layout = parent.layout()\nprintln(layout)\n\n//{origin={0.0, 0.0}, size={300.0, 300.0}}\n//\t{origin={10.0, 100.0}, size={195.0, 100.0}}\n//\t{origin={215.0, 125.0}, size={39.0, 50.0}}\n//\t{origin={264.0, 60.0}, size={26.0, 180.0}}\n```\n\nAlternatively, you could apply the layout to a view hierarchy (after ensuring Auto Layout is off):\n\n```swift\nlayout.apply(someView)\n```\n\nSee [SwiftBoxDemo](SwiftBoxDemo/SwiftBoxDemo) for a demo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshaber%2FSwiftBox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshaber%2FSwiftBox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshaber%2FSwiftBox/lists"}