{"id":23749311,"url":"https://github.com/sobabear/addthen","last_synced_at":"2025-09-04T22:31:49.922Z","repository":{"id":46267378,"uuid":"412384243","full_name":"sobabear/AddThen","owner":"sobabear","description":"🎨 Adding view sugar for UIKit with SwiftUI style","archived":false,"fork":false,"pushed_at":"2024-01-23T13:51:45.000Z","size":63,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-30T21:48:43.159Z","etag":null,"topics":["cocoapods","ios","swift","swiftpackagemanager","swiftui","xcode"],"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/sobabear.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}},"created_at":"2021-10-01T08:14:53.000Z","updated_at":"2024-02-09T15:10:08.000Z","dependencies_parsed_at":"2024-01-23T04:27:16.008Z","dependency_job_id":"c4f1ce73-84f0-4380-9618-6fda7e739946","html_url":"https://github.com/sobabear/AddThen","commit_stats":null,"previous_names":["stareta1202/addthen"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sobabear%2FAddThen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sobabear%2FAddThen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sobabear%2FAddThen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sobabear%2FAddThen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sobabear","download_url":"https://codeload.github.com/sobabear/AddThen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231999611,"owners_count":18458181,"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":["cocoapods","ios","swift","swiftpackagemanager","swiftui","xcode"],"created_at":"2024-12-31T15:16:30.169Z","updated_at":"2024-12-31T15:16:31.329Z","avatar_url":"https://github.com/sobabear.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AddThen\n\n[![CI Status](https://img.shields.io/travis/stareta1202/AddThen.svg?style=flat)](https://travis-ci.org/stareta1202/AddThen)\n[![Version](https://img.shields.io/cocoapods/v/AddThen.svg?style=flat)](https://cocoapods.org/pods/AddThen)\n[![License](https://img.shields.io/cocoapods/l/AddThen.svg?style=flat)](https://cocoapods.org/pods/AddThen)\n[![Platform](https://img.shields.io/cocoapods/p/AddThen.svg?style=flat)](https://cocoapods.org/pods/AddThen)\n\n🎨 View instance sugar for Swift \u0026 UIKit \n## Example\n\nAdd UIView \u0026 UIViewController code with **AddThen**\n```swift\n\nlet label = UILabel()\nlabel.backgroundColor = .red\nlabel.text = \"Hello, World\"\n\n...\n\nview.addSubview(label)\n```\n\nThis is equivalent to :\n```swift\nlet label = UILabel()\n\n...\n\nview.add(label) {\n  $0.backgroundColor = .red\n  $0.text = \"Hello, World!\"\n}\n\nview.add(\n  UIStackView { \n    UIButton()\n    UIView()\n    UIImageView()\n  }\n)\n\n```\nAlso very useful with SnapKit\n\n```swift\nlet label = UILabel()\n\n...\n\nview.add(label) {\n  $0.backgroundColor = .red\n  $0.text = \"Hello, World!\"\n  \n  $0.snp.makeConstraints {\n    $0.edges.equalToSuperview()\n  }\n}\n\n```\n\n## More SwiftUIfully\n```swift\n/// in certain function in UIViewController\nlet label = UILabel()\n\nbody {\n    label.then({ $0.textColor = .red })\n    UIButton()\n\n}\n\nbody {\n    if true {\n        UIView()\n    } else {\n        EmptyView() // EmptyView will not be added \n    }\n}\n\n```\n\nif you want to handle certain view which should not be added, use `Emptiable` or `EmptyView`\n\n## Requirements\n\n- iOS 9.0+ (11.0+ recommended)\n- Xcode 12.0+\n- Swfit 5.0 \n\n## Installation\n\nAddThen is available through [CocoaPods](https://cocoapods.org) \u0026 SPM. To install\nit, simply add the following line to your Podfile:\n\n### cocoapod\n\n```ruby\npod 'AddThen'\n```\n### Swift Package Manager\n```swift\nimport PackageDescription\n\nlet package = Package(\n  name: \"MyApp\",\n  dependencies: [\n    .package(url: \"https://github.com/sobabear/AddThen\", .upToNextMajor(from: \"1.2.3\")),\n  ]\n)\n```\n## Author\n\n- Yongjun Lee, stareta1202\n- Chanwoo Cho, [GREENOVER](https://github.com/GREENOVER)\n\n## License\n\nAddThen 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%2Fsobabear%2Faddthen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsobabear%2Faddthen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsobabear%2Faddthen/lists"}