{"id":18861652,"url":"https://github.com/pardnchiu/ExSwift","last_synced_at":"2025-04-14T13:31:41.653Z","repository":{"id":133389465,"uuid":"191607473","full_name":"pardnchiu/ExSwift","owner":"pardnchiu","description":"ExSwift is a declarative UIKit extension, enabling fluent chaining syntax. Streamlines iOS UI development with enhanced components, intuitive layouts, and native compatibility.","archived":false,"fork":false,"pushed_at":"2024-12-16T10:10:10.000Z","size":1811,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T13:26:59.834Z","etag":null,"topics":["chiuchingwei","declarative-programming","fluent-chaining-methods","pardnchiu","pardnio","pardnltd","swift-library"],"latest_commit_sha":null,"homepage":"","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/pardnchiu.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":"2019-06-12T16:26:53.000Z","updated_at":"2025-02-01T06:51:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"42d4cc88-8795-4458-bd88-b029ca473e31","html_url":"https://github.com/pardnchiu/ExSwift","commit_stats":null,"previous_names":["pardnchiu/swift-pdextension","pardnchiu/exswift"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pardnchiu%2FExSwift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pardnchiu%2FExSwift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pardnchiu%2FExSwift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pardnchiu%2FExSwift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pardnchiu","download_url":"https://codeload.github.com/pardnchiu/ExSwift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248888689,"owners_count":21178093,"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":["chiuchingwei","declarative-programming","fluent-chaining-methods","pardnchiu","pardnio","pardnltd","swift-library"],"created_at":"2024-11-08T04:30:42.403Z","updated_at":"2025-04-14T13:31:41.646Z","avatar_url":"https://github.com/pardnchiu.png","language":"Swift","readme":"新版 Framework 正在優化中，後續將釋出給各位方便整合導入。\n\n新版擴展特色與功能優化\n\n新版擴展將對項目進行全面升級，針對各項擴展進行優化，並引入以下核心改進：\n- 避免與原生方法衝突\n  除了少量需要在原生擴展以外，剩餘自定義擴展功能將採用繼承方式，獨立命名空間，確保穩定性和兼容性。\n- 統一命名與類型設計\n  新版將對常見 UIKit 元件提供專屬子類，結構清晰，使用更靈活。\n  例如：\n  - UIView → ExZStack\n  - UILabel → ExText\n  - UIButton → ExButton\n  - UIImageView → ExImage\n  - UITextfield → ExTextField\n  - UITextView → ExTextEditor\n  - UIStackView → ExVStack, ExHStack, ExStack\n  - UIScrollView → ExVScroll, ExHScroll, ExScroll\n\n- 高效功能整合\n新版框架將集成多項優化功能，簡化開發流程，提升代碼可讀性與可維護性。\n\n## 文檔 (還在整理，後續會主要用網站展示)\n- [ExZStack](./README/ExZStack.md)\n- [ExText](./README/ExText.md)\n- [ExButton](./README/ExButton.md)\n- [ExImage](./README/ExImage.md)\n- [ExTextField](./README/ExTextfield.md)\n- [ExTextEditor](./README/ExTextEditor.md)\n- [ExStack](./README/ExStack.md)\n- [ExScroll](./README/ExScroll.md)\n\n## 範例\n\n\u003e [!Note]\n\u003e 快速構建複雜界面 使用鏈式語法與巢狀結構，無需冗長的屬性設定語句，即可快速構建層次清晰的 UI 元件，顯著提升代碼的可讀性與可維護性。\n\n```Swift\nvar bool = false;\nmyView.subview([\n    // 主容器視圖\n    ExZStack()\n        .frame(x: 0, y: 0, width: 300, height: 400) // 設置框架大小\n        .background(color: .white) // 背景設為白色\n        .subview([\n            // 子視圖 1：標題容器\n            ExZStack()\n                .frame(x: 10, y: 10, width: 280, height: 50) // 設置大小與位置\n                .background(color: .lightGray) // 背景設為淺灰\n                .subview([\n                    ExText()\n                        .frame(x: 10, y: 10, width: 260, height: 30) // 設置標籤框架\n                        .text(\"標題1\", color: .red, alignment: .center) // 設置標題文字\n                        .background(color: .clear) // 背景透明\n                        .if(bool) {\n                            $0.text(\"標題2\", color: .black, alignment: .center) // 設置標題文字\n                        }\n                ]),\n\n            // 子視圖 2：按鈕容器\n            ExZStack()\n                .frame(x: 10, y: 70, width: 280, height: 300) // 按鈕容器框架\n                .background(color: .gray) // 背景設為灰色\n                .subview([\n                    ExButton()\n                        .frame(x: 20, y: 20, width: 120, height: 40) // 按鈕1框架\n                        .background(color: .blue) // 按鈕默認背景藍色\n                        .text(\"按鈕1\", color: .red, state: .normal) // 按鈕文字紅色\n                        .action(.touchUpInside) {\n                            $0.background(color: .red) // 點擊後背景變紅\n                              .text(\"已點擊\", color: .white, state: .normal) // 文字變白\n                        },\n                    ExButton()\n                        .frame(x: 140, y: 20, width: 120, height: 40) // 按鈕2框架\n                        .background(color: .red, state: .normal) // 按鈕默認背景紅色\n                        .background(color: .blue, state: .disabled) // 禁用時背景藍色\n                        .text(\"按鈕2\", color: .red, state: .normal) // 默認文字紅色\n                        .text(\"已停用\", state: .disabled) // 禁用時文字\n                        .action(.touchUpInside) {\n                            $0.isEnabled = false // 點擊後禁用按鈕\n                        }\n                ])\n        ])\n])\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpardnchiu%2FExSwift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpardnchiu%2FExSwift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpardnchiu%2FExSwift/lists"}