{"id":18374268,"url":"https://github.com/mnkgitbox/uikitchain","last_synced_at":"2025-04-11T02:44:27.709Z","repository":{"id":56924956,"uuid":"448625295","full_name":"MnkGitBox/UIKitChain","owner":"MnkGitBox","description":"Using the UIKitChain framework, You can create a UIKit component in one line of code.","archived":false,"fork":false,"pushed_at":"2022-02-12T05:45:46.000Z","size":2614,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-15T21:47:07.843Z","etag":null,"topics":["programatically","swift","uikit","uikit-components","uikit-framework","uiview","uiview-extension"],"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/MnkGitBox.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":"2022-01-16T17:31:19.000Z","updated_at":"2022-09-01T23:20:08.000Z","dependencies_parsed_at":"2022-08-20T22:50:28.687Z","dependency_job_id":null,"html_url":"https://github.com/MnkGitBox/UIKitChain","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MnkGitBox%2FUIKitChain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MnkGitBox%2FUIKitChain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MnkGitBox%2FUIKitChain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MnkGitBox%2FUIKitChain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MnkGitBox","download_url":"https://codeload.github.com/MnkGitBox/UIKitChain/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248331672,"owners_count":21085950,"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":["programatically","swift","uikit","uikit-components","uikit-framework","uiview","uiview-extension"],"created_at":"2024-11-06T00:14:03.718Z","updated_at":"2025-04-11T02:44:27.690Z","avatar_url":"https://github.com/MnkGitBox.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"![banner](UIKitChain_Banner.png)\n\n[![Version](https://img.shields.io/cocoapods/v/UIKitChain.svg?style=flat)](https://cocoapods.org/pods/UIKitChain)\n[![License](https://img.shields.io/cocoapods/l/UIKitChain.svg?style=flat)](https://cocoapods.org/pods/UIKitChain)\n[![Platform](https://img.shields.io/cocoapods/p/UIKitChain.svg?style=flat)](https://cocoapods.org/pods/UIKitChain)\n![SPM](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-orange)\n\nUsing the UIKitChain framework, You can create a UIKit component in one line of code.\n\u003cbr\u003e\n\n### Installation\n\n#### CocoaPods\n[CocoaPods](https://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:\n\n```ruby\n$ gem install cocoapods\n```\nTo integrate UIKitChain into your Xcode project using CocoaPods, specify it in your Podfile:\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '12.0'\nuse_frameworks!\n\ntarget '\u003cYour Target Name\u003e' do\n    pod 'UIKitChain', '~\u003e 1.0.0'\nend\n```\nThen, run the following command:\n```ruby\n$ pod install\n```\n\n#### Swift Package Manager\n\n[Swift Package Manager](https://swift.org/package-manager/) is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.\n\n\u003e Xcode 11+ is required to build UIKitChain using Swift Package Manager.\n\n```Swift\ndependencies: [\n    .package(url: \"https://github.com/MnkGitBox/UIKitChain.git\", .upToNextMajor(from: \"1.0.0\"))\n]\n```\n\n#### Manually\n\nIf you prefer not to use either of the aforementioned dependency managers, you can integrate UIKitChain into your project manually.\n\n---\n\n### Usage\nCall the `.chain` method right after initializing the UI element. Then you can configure the element using dot notation and finally call `.component` to get your complete view element.\n -  Without UIKitChain\n```Swift \nlet circleView = UIView()\ncircleView.backgroundColor = .green\ncircleView.layer.cornerRadius = 50\ncircleView.layer.borderColor = UIColor.black.cgColor\ncircleView.layer.borderWidth = 1\ncircleView.clipsToBounds = true\ncircleView.translatesAutoresizingMaskIntoConstraints = false\n```\n - With UIKitChain\n```Swift\nlet circleView = UIView().chain.bgColor(.green).cornerRadius(50).clipToBounds(true).border(.black).activeAutoConstrant(false).component\n```\n\n### Add Missing Method or Variable\n\nIf there is any missing method or variable, You can add by extending the `UIKitChain` with the corresponding *UIKit element*.\n\n```Swift\nextension UIKitChain where Component: UIView {\n    @discardableResult\n    func roundView() -\u003e Self {\n        component.layer.cornerRadius = component.bounds.height/2\n        return self\n    }\n}\n```\n### Resources\n\nYou can find the original sample code [here](SampleCode.swift).\n\n## Credits\n- Malith Nadeeshan ([malithnadeeshan](https://twitter.com/malithnadeeshan))\n\n## License\n\nUIKitChain is released under the MIT license. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnkgitbox%2Fuikitchain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnkgitbox%2Fuikitchain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnkgitbox%2Fuikitchain/lists"}