{"id":20945164,"url":"https://github.com/tbxark/flexlayout","last_synced_at":"2025-05-14T01:31:41.484Z","repository":{"id":57680423,"uuid":"269256373","full_name":"TBXark/FlexLayout","owner":"TBXark","description":"Flex layout library similar to SwiftUI","archived":false,"fork":false,"pushed_at":"2022-12-20T02:37:28.000Z","size":4381,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-29T07:47:38.793Z","etag":null,"topics":["flexlayout","ios","layout","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/TBXark.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":"2020-06-04T03:59:49.000Z","updated_at":"2023-10-13T06:35:46.000Z","dependencies_parsed_at":"2022-09-14T11:11:15.136Z","dependency_job_id":null,"html_url":"https://github.com/TBXark/FlexLayout","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TBXark%2FFlexLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TBXark%2FFlexLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TBXark%2FFlexLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TBXark%2FFlexLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TBXark","download_url":"https://codeload.github.com/TBXark/FlexLayout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225269351,"owners_count":17447513,"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":["flexlayout","ios","layout","swift"],"created_at":"2024-11-18T23:47:00.944Z","updated_at":"2024-11-18T23:47:01.597Z","avatar_url":"https://github.com/TBXark.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FlexLayout\n\n`FlexLayout` is a flexible layout tool similar to SwiftUI syntax， `ConstraintLayout` is the syntactic sugar of  `NSLayoutAnchor`.\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n![demo](./demo.jpeg)\n\n\n```swift\n\nFL.V(frame: view.bounds) {\n    if #available(iOS 11.0, *) {\n        FL.Space.fixed(self.view.safeAreaInsets.top)\n    } else {\n        FL.Space.fixed(20)\n    }\n    FL.Bind(userInfoContent) { rect in\n        FL.H(size: rect.size) {\n            FL.Space.fixed(20)\n            self.avatarImgv.with(main: .fixed(60), cross: .fixed(60, offset: 0, align: .center))\n            FL.Space.fixed(20)\n            FL.Virtual { rect in\n                FL.V(frame: rect) {\n                    self.titleLabel.with(main: .fixed(30))\n                    FL.Space.grow()\n                    FL.Virtual { rect in\n                        FL.H(frame: rect) {\n                            self.linkName.with(main: .fixed(40))\n                            self.linkLabel.with(main: .grow)\n                        }\n                    }.with(main: .fixed(20))\n                }\n            }.with(main: .grow, cross: .fixed(60, offset: 0, align: .center))\n            FL.Space.fixed(20)\n        }\n    }.with(main: .fixed(100), cross: .stretch(margin: (start: 20, end: 20)))\n    FL.Space.grow()\n    self.bottomBar.with(main: .fixed(60), cross: .stretch(margin: (start: 20, end: 20)))\n    if #available(iOS 11.0, *) {\n        FL.Space.fixed(self.view.safeAreaInsets.bottom)\n    } else {\n        FL.Space.fixed(20)\n    }\n}\n\nCL.layout(clTest) {\n    clTest.centerXAnchor |== view.centerXAnchor\n    clTest.centerYAnchor |== view.centerYAnchor + 100\n    (clTest.heightAnchor \u0026 clTest.widthAnchor) |== 100\n}\nCL.layout(clTest2) {\n    clTest2.heightAnchor |== clTest.widthAnchor\n    clTest2.widthAnchor |== clTest.widthAnchor * 2 + 100\n    clTest2.centerXAnchor |== clTest.centerXAnchor\n    clTest2.bottomAnchor |== bottomBar.topAnchor\n}\n\n\n```\n\n## Requirements\n\nSwift, iOS 9.0+\n\n\n## Installation\n\nFlexLayout is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'TKFlexLayout', :git=\u003e'https://github.com/tbxark/FlexLayout.git'\n```\n\n## Author\n\ntbxark, tbxark@outlook.com\n\n## License\n\nFlexLayout is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftbxark%2Fflexlayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftbxark%2Fflexlayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftbxark%2Fflexlayout/lists"}