{"id":30719835,"url":"https://github.com/dankinsoid/vdlayout","last_synced_at":"2025-09-03T10:42:23.100Z","repository":{"id":56925575,"uuid":"338568160","full_name":"dankinsoid/VDLayout","owner":"dankinsoid","description":"Declarative wrapper on UIKit","archived":false,"fork":false,"pushed_at":"2024-07-09T20:46:10.000Z","size":622,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-15T15:05:46.816Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dankinsoid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"dankinsoid","open_collective":"voidilov-daniil","ko_fi":"dankinsoid","custom":["https://paypal.me/voidilovuae"]}},"created_at":"2021-02-13T12:19:09.000Z","updated_at":"2025-08-04T11:27:10.000Z","dependencies_parsed_at":"2024-07-10T01:10:10.572Z","dependency_job_id":null,"html_url":"https://github.com/dankinsoid/VDLayout","commit_stats":{"total_commits":118,"total_committers":2,"mean_commits":59.0,"dds":0.364406779661017,"last_synced_commit":"37c0c8a8f4a5a5330c8f2b9eae5a976f9e6eddf9"},"previous_names":[],"tags_count":156,"template":false,"template_full_name":null,"purl":"pkg:github/dankinsoid/VDLayout","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankinsoid%2FVDLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankinsoid%2FVDLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankinsoid%2FVDLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankinsoid%2FVDLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dankinsoid","download_url":"https://codeload.github.com/dankinsoid/VDLayout/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankinsoid%2FVDLayout/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273431361,"owners_count":25104491,"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-09-03T02:00:09.631Z","response_time":76,"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":"2025-09-03T10:42:22.203Z","updated_at":"2025-09-03T10:42:23.081Z","avatar_url":"https://github.com/dankinsoid.png","language":"Swift","funding_links":["https://github.com/sponsors/dankinsoid","https://opencollective.com/voidilov-daniil","https://ko-fi.com/dankinsoid","https://paypal.me/voidilovuae"],"categories":[],"sub_categories":[],"readme":"# VDLayout\n\n[![Version](https://img.shields.io/cocoapods/v/VDLayout.svg?style=flat)](https://cocoapods.org/pods/VDLayout)\n[![License](https://img.shields.io/cocoapods/l/VDLayout.svg?style=flat)](https://cocoapods.org/pods/VDLayout)\n[![Platform](https://img.shields.io/cocoapods/p/VDLayout.svg?style=flat)](https://cocoapods.org/pods/VDLayout)\n\n## Table of Contents\n- [Overview](#overview)\n- [Concepts](#concepts)\n- [Usage and Examples](#usage-and-examples)\n- [List of Methods and Extensions](#list-of-methods-and-extensions)\n- [Installation](#installation)\n- [Related Libraries](#related-libraries)\n- [Contributors](#contributors)\n\n## Overview\nVDLayout is a lightweight and intuitive Swift library designed to simplify the layout building process in UIKit. By providing convenient extensions on native UIKit components, it allows developers to easily and quickly define user interfaces in a manner that is clean, efficient, and easy to understand. This library aims to offer a smooth integration into any UIKit project, and also SwiftUI, by avoiding complex abstractions or magic. It's essentially a friendly UIKit companion, making your layout code more readable and maintainable.\n\n## Concepts\nVDLayout introduces several key concepts:\n\n- **Subview and SubviewBuilder**: These types allow for the creation and configuration of subviews within a parent view.\n- **UISubview and UISubviewController**: These are helper subclasses for UIView and UIViewController respectively. You can inherit these to override the `content` property.\n- [**Chain**](https://github.com/dankinsoid/VDChain): This is a view wrapper that enables method chaining on a view via keypaths.\n- [**pin(_:) methods**](https://github.com/dankinsoid/VDPin): These methods allow for the creation of auto-layout constraints.\n- [**UIKitView**](https://github.com/dankinsoid/UIKitViews): This is a SwiftUI wrapper around UIView and UIViewController that supports chaining and provides seamless integration of UIKit components with SwiftUI.\n- **CellsSection and ViewCell**: These structures are used for building and managing cells in table and collection views.\n- [**ViewCellsReloadable**](Docs/ReloadableViews.md): This is a protocol that marks a view as having reloadable cells.\n\nWith these elements, the library provides a simple, yet powerful toolkit for handling common layout tasks in UIKit.\n\n## Usage and Examples\nThe VDLayout library can be used to handle a variety of tasks.\n\nFor instance, you can easily chain together properties and methods on views:\n\n```swift\npublic final class SomeView: UISubview {\n\n  private let label = UILabel()\n\n  override public var content: any Subview {\n    UIStackView.V(spacing: 3, alignment: .center) {\n      label\n        .chain\n        .textAlignment(.center)\n        .textColor(.red)\n        .contentPriority(.required, axis: .horizontal, type: .compression)\n\t    \n      UILabel().chain\n        .text(\"Subtitle\")\n\n      UIButton().chain\n        .title(\"Tap me\")\n    }\n    .pin(.edges)\n  }\n\n  public func update(title: String) {\n    label.text = title\n  }\n}\n```\n\nYou can also use it to manage collections and tables:\n\n```swift\nlet dataSource = UITableViewSource()\nlet tableView = UITableView(dataSource)\n\ndataSource.reload(data: items) { _ in\n    SomeTableViewCell()\n} reload: { cell, item in\n  cell.text = item.name\n}\n```\n\n## List of Methods and Extensions\nVDLayout extends various UIKit components with numerous useful methods. For a full list, see [here](Docs/MethodsAndExtensions.md).\n\n## Installation\nVDLayout is available via Swift Package Manager (SPM). \n\nTo install it, simply add the following line to the dependencies value of your Package.swift:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/dankinsoid/VDLayout.git\", from: \"5.0.1\")\n]\n```\n\nThen, in your target dependencies, add `\"VDLayout\"`:\n\n```swift\ntargets: [\n    .target(\n        name: \"YourTarget\",\n        dependencies: [\"VDLayout\"]),\n]\n```\n\n## Related Libraries\nVDLayout makes use of several related libraries:\n\n- [VDPin](https://github.com/dankinsoid/VDPin): A Swift library for easy creation of AutoLayout constraints.\n- [VDChain](https://github.com/dankinsoid/VDChain): A Swift library that enables method chaining on views via keypaths.\n- [UIKitViews](https://github.com/dankinsoid/UIKitViews): A Swift library providing seamless integration of UIKit components with the SwiftUI framework\n\n## Contributors\n- Voidilov Daniil: Main Developer\n- OpenAI's ChatGPT: Contributor to README\n\nFor any queries or suggestions, feel free to open an issue on GitHub.\n\n--- \n\nThis document was co-authored by an OpenAI language model. The descriptions and examples have been reviewed for accuracy and clarity. If you have any corrections or improvements, please open an issue or make a pull request on GitHub.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdankinsoid%2Fvdlayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdankinsoid%2Fvdlayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdankinsoid%2Fvdlayout/lists"}