{"id":18421395,"url":"https://github.com/rebeloper/stax","last_synced_at":"2025-04-13T11:59:34.711Z","repository":{"id":169311231,"uuid":"316912218","full_name":"rebeloper/Stax","owner":"rebeloper","description":"🏆 Best way to build UI","archived":false,"fork":false,"pushed_at":"2020-12-11T11:17:01.000Z","size":4559,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-16T07:23:58.134Z","etag":null,"topics":["autolayout","constraints","declarative-programming","declarative-ui","hide-views","layout","scrolling","stack","stack-views","stacking","stacks","stax","swift","swiftui","ui","uiscrollview","uistacklayout","uistackview","uistackview-scrollable","vertical-stacks"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rebeloper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-11-29T09:00:53.000Z","updated_at":"2022-06-26T22:28:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"3c4c2ee8-86f0-4e3d-8ec8-3b589eaf2666","html_url":"https://github.com/rebeloper/Stax","commit_stats":null,"previous_names":["rebeloper/stax"],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rebeloper%2FStax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rebeloper%2FStax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rebeloper%2FStax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rebeloper%2FStax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rebeloper","download_url":"https://codeload.github.com/rebeloper/Stax/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710436,"owners_count":21149188,"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":["autolayout","constraints","declarative-programming","declarative-ui","hide-views","layout","scrolling","stack","stack-views","stacking","stacks","stax","swift","swiftui","ui","uiscrollview","uistacklayout","uistackview","uistackview-scrollable","vertical-stacks"],"created_at":"2024-11-06T04:25:31.337Z","updated_at":"2025-04-13T11:59:34.684Z","avatar_url":"https://github.com/rebeloper.png","language":"Swift","readme":"# 🥞 Stax\n\n**Stax** is a lightweight library that leverages Auto Layout, UIStackViews and UIScrollViews to build out your UI programmatically with just a few lines of code.\n\n## 💻 Installation\n### 📦 Swift Package Manager\nUsing \u003ca href=\"https://swift.org/package-manager/\" rel=\"nofollow\"\u003eSwift Package Manager\u003c/a\u003e, add it as a Swift Package in Xcode 11.0 or later, `select File \u003e Swift Packages \u003e Add Package Dependency...` and add the repository URL:\n```\nhttps://github.com/rebeloper/Stax.git\n```\n### ✊ Manual Installation\nDownload and include the `Stax` folder and files in your codebase.\n\n### 📲 Requirements\n- iOS 11+ (some optional features iOS13+)\n- Swift 5\n\n## 👑 Concept\n`Stax` uses the idea of laying out your views entirely with **Stacks**. Under the hood it uses `UIStackView`s to create horizontal or vertical stacks. You may set any of these **Stacks** to be scrollable. **Stacks** are nestable and follow a declarative writing style. As a bonus you may also center a view inside another one.\n\n## 🧳 Features\n- [X] Pure Swift 5 sweetness.\n- [X] Everything you can do with Auto Layout, but shorter.\n- [X] Constraints are active by default.\n- [X] 100% compatible with other Auto Layout code.\n- [X] No need to set `translatesAutoresizingMaskIntoConstraints` because `Stax` does it for you.\n- [X] Leverages the power of `UIScrollView` and `UIStackView`: stack views, scroll views.\n- [X] Scroll programmatically to top / bottom / left / right.\n- [X] Lay out views with Stacks **only**.\n- [X] Show / hide views on the fly.\n- [X] Write UI code in a declarative way (much like in `SwiftUI`).\n- [X] Easy-to-understand usage.\n- [X] No external dependencies.\n- [X] 100% Documented.\n\n## 🛠 Before we begin\n\nThis UIViewController structure is assumed in the following examples\n\n```\nimport UIKit\nimport Stax\n\nclass ExampleViewController: UIViewController {\n    \n    // MARK: - Views\n    \n    // MARK: - Layout views\n    \n    fileprivate func layoutViews() {\n        \n    }\n    \n    // MARK: - Lifecycle\n    \n    override func viewDidLoad() {\n        super.viewDidLoad()\n        view.backgroundColor = .systemBackground\n        title = \"Stax\"\n        layoutViews()\n    }\n}\n```\n\nIn the examples below we will cover the code that is marked as **Views** and **Layout views**\n\n## 👉 Import\n\nImport `Stax` into your `ViewController`\n\n```\nimport Stax\n```\n\n## 📚 A word about how `UIStackViews` work and `size` setting with `Stax`\n\n`UIStackViews` are pull-in views: they take up the least amount of space from their parent view filling themselves with the least amount of space that their arranged subviews need. Thus it's crucial that all views added to the **Stack** have their own size. Some views do have an intrisic size (a size set automatically upon initialization): `UIButton`, `UILabel`. But not all views have an intrinsic size: `UIView`, `UIImageView`. So here are the ways we can set size in `Stax`\n\n## 📏 Size\n\n```\nlet view0 = UIView(width: 100)\nlet view1 = UIView(height: 100)\nlet view2 = UIView(width: 100, height: 200)\nlet view3 = UIView(square: 100)\nlazy var view4 = UIView(width: self.view.frame.size.width)\n```\n\nNote: if we want to get acces to `self` when we create these views they must be `lazy var`.\n\n## 🎨 Background color\n\nWe may also add background color within the initialization of any `UIView`. Helpful when laying out views quickly. This way we see the frame of the views in an easy tweak. All types of previously listed initializations have this optional property. Default value is `.clear`.\n\n```\nlet view0 = UIView(width: 100, backgroundColor: .systemBlue)\n```\n\nAdding a background color to or view to debug our layout is common practice, but `Stax` has something more powerfull: `StaxDebugOptions`. When added as a property to a `UIView` you will see a debug layer on top of your view. Default value is `nil` which will not add any debug layer. `StaxDebugOptions` is available on iOS13+.\n\n```\nlet view0 = UIView(width: 100, staxDebugOptions: StaxDebugOptions())\n```\n\nWe will talk more in detail about `StaxDebugOptions` below when we will show them inside a stack.\n\n## 👈.....👉 Spacer\n\nSince `UIStackView` is a pull-in view we will need a push-out view in order to use them more efficiently. This is where `Spacer` comes in. It is an empty `UIView` that can push views. Here's an example of a `Spacer` pushing `view2` to the top in this `VStack` layed out in the view controller's `view`. (Don't worry about understanding the stack or the layout. We'll talk about them soon enough.)\n\n```\n// MARK: - Views\n\nlet view0 = UIView(height: 100, backgroundColor: .systemBlue, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    VStack(\n        view0,\n        Spacer()\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00000.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n## 👈.👉 Divider\n\nDividers are much like `Spacer`s but they have a fixed `width` / `height`. By default this value is `16`. Dividers have two axis: `.vertical`, `.horizontal`. Default axis is `.vertical`. You may also want to use `VDivider` and `HDivider`. \nNote: `Divider`s ususally do not have a background color. I'm just using `.systemOrange` here so we may see it on screen.\n\n```\n// MARK: - Views\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    VStack(\n        Divider().background(color: .systemOrange),\n        Spacer()\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00002.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n```\n// MARK: - Views\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    VStack(\n        Divider(.vertical, 400).background(color: .systemOrange),\n        Spacer()\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00003.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n```\n// MARK: - Views\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    VStack(\n        VDivider().background(color: .systemOrange),\n        Spacer()\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00004.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n```\n// MARK: - Views\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    VStack(\n        VDivider(400).background(color: .systemOrange),\n        Spacer()\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00005.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n```\n// MARK: - Views\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    HStack(\n        Divider(.horizontal).background(color: .systemOrange),\n        Spacer()\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00006.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n```\n// MARK: - Views\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    HStack(\n        Divider(.horizontal, 300).background(color: .systemOrange),\n        Spacer()\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00007.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n```\n// MARK: - Views\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    HStack(\n        HDivider().background(color: .systemOrange),\n        Spacer()\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00006.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n```\n// MARK: - Views\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    HStack(\n        HDivider(300).background(color: .systemOrange),\n        Spacer()\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00007.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n## 👇___ Line ( available iOS 13.0+ )\n\nAdding a line in your UI is common. You may add a `Line` with a lot of properties, `VLine` for a vertical line, `HLine` for a horizontal line.\n\n```\n// MARK: - Views\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    VStack(\n        VDivider(400).background(color: .systemOrange),\n        HLine(),\n        VDivider().background(color: .systemOrange),\n        Spacer()\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00008.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n```\n// MARK: - Views\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    HStack(\n        HDivider(300).background(color: .systemOrange),\n        VLine(),\n        HDivider().background(color: .systemOrange),\n        Spacer()\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00001.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n```\n// MARK: - Views\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    VStack(\n        VDivider(400).background(color: .systemOrange),\n        Line(.horizontal, 6, UIColor.black.withAlphaComponent(0.5), insets: UIEdgeInsets(top: 0, left: 48, bottom: 0, right: 48)),\n        VDivider().background(color: .systemOrange),\n        Spacer()\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00009.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n```\n// MARK: - Views\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    HStack(\n        HDivider(300).background(color: .systemOrange),\n        VLine(30, .black, insets: UIEdgeInsets(top: 10, left: 0, bottom: 50, right: 0), withRoundedCorners: false),\n        HDivider().background(color: .systemOrange),\n        Spacer()\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00010.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n## 🐞 Debuging\n\nWe may put a debug view on any of our views. You may initialize any `UIView` with the `staxDebugOptions` property.\n\n```\n// MARK: - Views\n\nlet view0 = UIView(height: 100, backgroundColor: .systemBlue, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    VStack(\n        view0,\n        Spacer()\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00011.png\" width=\"1350px\"\u003e\n\u003c/details\u003e\n\nWhen you do not want to initialize with `staxDebugOptions` you may debug the view inside the stack.\n\n```\n// MARK: - Views\n\nlet view0 = UIView(height: 100, backgroundColor: .systemBlue)\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    VStack(\n        view0.debug(),\n        Spacer()\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00012.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\nYou may create your own custom debug options.\n\n```\n// MARK: - Custom Debug Options\nlet customStaxDebugOptions = StaxDebugOptions(borderWidth: 5, cornerRadius: 0, color: .systemRed, lineWidth: 10, font: .italicSystemFont(ofSize: 30), textColor: .darkGray, textCornerRadius: 15)\n\n// MARK: - Views\n\nlazy var view0 = UIView(height: 300, backgroundColor: .systemBlue, staxDebugOptions: customStaxDebugOptions)\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    VStack(\n        view0,\n        Spacer()\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00013.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\nOr use one of the preset ones. Default is `adaptive`. See the diferent `type`s ont both light and dark appearance below.\n\n```\n// MARK: - Views\n\nlazy var view0 = UIView(height: 200, backgroundColor: .systemBlue, staxDebugOptions: StaxDebugOptionsType.dark)\nlazy var view1 = UIView(height: 200, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptionsType.light)\nlazy var view2 = UIView(height: 200, backgroundColor: .systemRed, staxDebugOptions: StaxDebugOptionsType.adaptive)\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    VStack(\n        view0,\n        view1,\n        view2,\n        Spacer()\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot Light\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00014.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot Dark\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00015.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n## 🎨 Background color on views inside stacks, on stacks and on scroll views\n\nWhen you build out views with `Stax` you may not properly evaluate where the stack's views are layed out exactly. To make our lives easier we can just simply add background colors. We can add a background color to: `UIView`, `UIStackView` and `UIScrollView`.\n\n```\n// MARK: - Views\n\nlet view0 = UIView(height: 100, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    VStack(\n        view0.background(color: .systemOrange),\n        Spacer()\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00016.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n```\n// MARK: - Views\n\nlet view0 = UIView(height: 100, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    VStack(\n        view0.background(color: .systemOrange),\n        Spacer()\n    ).background(.systemBlue).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00017.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n```\n// MARK: - Views\n\nlet view0 = UIView(height: 100, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    VStack(\n        view0.background(color: .systemOrange),\n        Spacer()\n    ).scrolls().background(.systemGreen).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00018.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n## 🍩 Centering \n\nThe second most important part in laying out UI in `Stax` besides stacking is **centering** a view inside a parent view. Centering has to be done outside of the main stack. See the example view controller below.\n\n```\n// MARK: - Views\n\nlet view0 = UIView(height: 400, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\nlet view1 = UIView(backgroundColor: .systemBlue, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    \n    view1.center(in: view0, size: .square(100), offset: CGPoint(x: 70, y: 80))\n    \n    VStack(\n        view0,\n        Spacer()\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00019.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n```\n// MARK: - Views\n\nlet view0 = UIView(height: 400, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\nlet view1 = UIView(width: 100, backgroundColor: .systemBlue, staxDebugOptions: StaxDebugOptions())\nlet view2 = UIView(width: 100, backgroundColor: .systemGreen, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    \n    HStack(view1, view2).center(in: view0, size: CGSize(width: 200, height: 100), offset: CGPoint(x: 70, y: 80))\n    \n    VStack(\n        view0,\n        Spacer()\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00020.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n```\n// MARK: - Views\n\nlet view0 = UIView(height: 400, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\nlet view1 = UIView(width: 100, backgroundColor: .systemBlue, staxDebugOptions: StaxDebugOptions())\nlet view2 = UIView(width: 100, backgroundColor: .systemGreen, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    \n    HStack(view1, view2).scrolls(.horizontal).center(in: view0, size: .square(100), offset: CGPoint(x: 70, y: 80))\n    \n    VStack(\n        view0,\n        Spacer()\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00021.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n## 🍔 Stacks\n\nThere are two types of Stacks in `Stax`: `VStack` and `HStack` (Vertical Stack and Horizontal Stack).\nThe way we add a stack onto any view is laying it with `layout(in:)`. Usually this is done only once with the main Stack layed out in the view controller's view. You may also lay out with taking the safe area into acount.\n\n```\n// MARK: - Views\n\nlet view0 = UIView(height: 200, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\nlet view1 = UIView(height: 200, backgroundColor: .systemBlue, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    \n    VStack(\n        Spacer(),\n        view0,\n        view1\n    ).layout(in: view)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00022.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n```\n// MARK: - Views\n\nlet view0 = UIView(height: 200, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\nlet view1 = UIView(height: 200, backgroundColor: .systemBlue, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    \n    VStack(\n        Spacer(),\n        view0,\n        view1\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00023.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n```\n// MARK: - Views\n\nlet view0 = UIView(width: 200, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\nlet view1 = UIView(width: 200, backgroundColor: .systemBlue, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    \n    HStack(\n        Spacer(),\n        view0,\n        view1\n    ).layout(in: view)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00024.png\" height=\"350px\"\u003e\n\u003c/details\u003e\n\n```\n// MARK: - Views\n\nlet view0 = UIView(width: 200, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\nlet view1 = UIView(width: 200, backgroundColor: .systemBlue, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    \n    HStack(\n        Spacer(),\n        view0,\n        view1\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00024.png\" height=\"350px\"\u003e\n\u003c/details\u003e\n\nNote: The `Spacer` is pushing the two views out to the sides of the container view.\n\nYou can have stacks within stacks.\n\n```\n// MARK: - Views\n\nlet view0 = UIView(square: 150, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\nlet view1 = UIView(width: 100, backgroundColor: .systemBlue, staxDebugOptions: StaxDebugOptions())\nlet view2 = UIView(height: 200, backgroundColor: .systemGreen, staxDebugOptions: StaxDebugOptions())\nlet view3 = UIView(height: 170, backgroundColor: .systemYellow, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    \n    VStack(\n        HStack(view0,\n               view1,\n               Spacer()),\n        VStack(view2,\n               view3),\n        Spacer()\n    ).layout(in: view, withSafeArea: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00026.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n## 📜 Scrolling\n\nYou can enable scrolling with one line.\n\n```\n// MARK: - Views\n\nlet view0 = UIView(square: 150, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\nlet view1 = UIView(width: 500, backgroundColor: .systemBlue, staxDebugOptions: StaxDebugOptions())\nlet view2 = UIView(height: 200, backgroundColor: .systemGreen, staxDebugOptions: StaxDebugOptions())\nlet view3 = UIView(height: 500, backgroundColor: .systemYellow, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    \n    VStack(\n        HStack(view0,\n               view1,\n               Spacer()).scrolls(.horizontal),\n        VStack(view2,\n               view3),\n        Spacer()\n    ).scrolls().layout(in: view)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00027.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\nNotes: \n- The defalyt value is `.vertical`. \n- We can remove the safe area property from `layout(in:)` because the navigation bar will push the main stack to the tab bar's bottom. When a Tab bar is also added it will also behave as the navigation bar pushin gthe stack to the top of the tab bar. Of course, you may leave the safe area property if that is needed for your specific layout. \n- Notice the `Spacer()`s. This is left here because your layput may be viewed on displays with a `width`/`height` larger than the Stacks' `width`/`height`. In this case the `ScrollView` will act as a `StackView`.\n\n## 👉👈 Spacing\n\nSpacing between the stack elements is also simple. Default value is `8`.\n\n```\n// MARK: - Views\n\nlet view0 = UIView(height: 150, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\nlet view1 = UIView(height: 50, backgroundColor: .systemBlue, staxDebugOptions: StaxDebugOptions())\nlet view2 = UIView(height: 100, backgroundColor: .systemGreen, staxDebugOptions: StaxDebugOptions())\nlet view3 = UIView(height: 150, backgroundColor: .systemYellow, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    \n    VStack(\n        view0,\n        view1,\n        view2,\n        view3,\n        Spacer()\n    ).spacing().scrolls().layout(in: view)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00028.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n```\n// MARK: - Views\n\nlet view0 = UIView(height: 150, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\nlet view1 = UIView(height: 50, backgroundColor: .systemBlue, staxDebugOptions: StaxDebugOptions())\nlet view2 = UIView(height: 100, backgroundColor: .systemGreen, staxDebugOptions: StaxDebugOptions())\nlet view3 = UIView(height: 150, backgroundColor: .systemYellow, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    \n    VStack(\n        view0,\n        view1,\n        view2,\n        view3,\n        Spacer()\n    ).spacing(36).scrolls().layout(in: view)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00029.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n## 🌅 Padding\n\nPadding can be added to both `Stack` and `ScrollView`. Default value is `8`.\n\n```\n// MARK: - Views\n\nlet view0 = UIView(height: 150, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    \n    VStack(\n        view0,\n        Spacer()\n    )/*.scrolls()*/.padding().layout(in: view)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00030.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n```\n// MARK: - Views\n\nlet view0 = UIView(height: 150, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    \n    VStack(\n        view0,\n        Spacer()\n    )/*.scrolls()*/.padding(by: 36).layout(in: view)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00031.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n```\n// MARK: - Views\n\nlet view0 = UIView(height: 150, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    \n    VStack(\n        view0,\n        Spacer()\n    )/*.scrolls()*/.padding(UIEdgeInsets(top: 36, left: 24, bottom: 0, right: 12)).layout(in: view)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00032.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n```\n// MARK: - Views\n\nlet view0 = UIView(height: 150, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    \n    VStack(\n        view0,\n        Spacer()\n    )/*.scrolls()*/.padding(.top).layout(in: view)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00033.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n```\n// MARK: - Views\n\nlet view0 = UIView(height: 150, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    \n    VStack(\n        view0,\n        Spacer()\n    )/*.scrolls()*/.padding(.top, 36).layout(in: view)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00034.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n## ⚙️ Scrolling Options\n\nWe can set basic options on the `ScrollView`:\n\n```\n// MARK: - Views\n\nlazy var view0 = UIView(square: self.view.frame.width, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\nlazy var view1 = UIView(width: self.view.frame.width, backgroundColor: .systemBlue, staxDebugOptions: StaxDebugOptions())\nlazy var view2 = UIView(width: self.view.frame.width, backgroundColor: .systemRed, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    VStack(\n        HStack(\n            view0,\n            view1,\n            view2,\n            Spacer()\n        ).scrolls(.horizontal)\n        .pages()\n        .hidesScrollIndicator()\n//            .showsScrollIndicator()\n        .bounces(false)\n        .height(self.view.frame.width),\n        Spacer()\n    ).scrolls().layout(in: view)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00035.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n## 🦾 Auto-scrolling\n\nWe can also automatically scroll to a specific view. You might want to delay the scroll by `0.05` when you are scrolling upon initializing the view controller. Default `delay` is `0`. Default `animated` is `true`. You must specifiy the `axis` of the scroll. You may also set an optional offset too.\n\n```\n// MARK: - Views\n\nlazy var view0 = UIView(square: self.view.frame.width, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\nlazy var view1 = UIView(width: self.view.frame.width, backgroundColor: .systemBlue, staxDebugOptions: StaxDebugOptions())\nlazy var view2 = UIView(width: self.view.frame.width, backgroundColor: .systemRed, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    VStack(\n        HStack(\n            view0,\n            view1,\n            view2,\n            Spacer()\n        ).scrolls(.horizontal)\n        .scroll(to: view1, axis: .horizontal, delay: 2)\n        .height(self.view.frame.width),\n        Spacer()\n    ).scrolls().layout(in: view)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00036.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\nWe can set the scroll to a type. On an `HStack` we may use `.toLeft` and `.toRight`. On a `VStack` we may use `toTop` and `toBottom`.\n\n```\n// MARK: - Views\n\nlazy var view0 = UIView(square: self.view.frame.width, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\nlazy var view1 = UIView(width: self.view.frame.width, backgroundColor: .systemBlue, staxDebugOptions: StaxDebugOptions())\nlazy var view2 = UIView(width: self.view.frame.width, backgroundColor: .systemRed, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    VStack(\n        HStack(\n            view0,\n            view1,\n            view2,\n            Spacer()\n        ).scrolls(.horizontal)\n        .scroll(.toRigh, delay: 2)\n        .height(self.view.frame.width),\n        Spacer()\n    ).scrolls().layout(in: view)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00037.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\nBy setting `animated` to `false` we get rid of the scroll animation and jump straigth to where we want to.\n\n```\n// MARK: - Views\n\nlazy var view0 = UIView(square: self.view.frame.width, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\nlazy var view1 = UIView(width: self.view.frame.width, backgroundColor: .systemBlue, staxDebugOptions: StaxDebugOptions())\nlazy var view2 = UIView(width: self.view.frame.width, backgroundColor: .systemRed, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    VStack(\n        HStack(\n            view0,\n            view1,\n            view2,\n            Spacer()\n        ).scrolls(.horizontal)\n        .scroll(.toRigh, delay: 2, animated: false)\n        .height(self.view.frame.width),\n        Spacer()\n    ).scrolls().layout(in: view)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00038.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n## ⚙️ Stack Options\n\nStacks are configured for easy layout and it is not advised to change thes options only when you know what you're doing.\n\n```\n// MARK: - Views\n\nlazy var view0 = UIView(backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\nlazy var view1 = UIView(backgroundColor: .systemBlue, staxDebugOptions: StaxDebugOptions())\nlazy var view2 = UIView(backgroundColor: .systemRed, staxDebugOptions: StaxDebugOptions())\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    VStack(\n        HStack(\n            view0,\n            view1,\n            view2,\n            Spacer()\n        )\n        .axis(.horizontal) // optionally set stack axis; default is: .vertical\n        .alignment(.fill) // optionally set stack alignment; default is: .fill\n        .distribution(.fillEqually) // optionally set stack distribution; default is: .fill\n        .height(self.view.frame.width),\n        Spacer()\n    )\n    .scrolls().layout(in: view)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00039.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\nNote: \n- none of the views have a prespecified size\n- the `Spacer()` is counted for the 4th view in the `HStack` and has exactly the same widht as the other views because `distribution` is set to `.fillEqually`\n\n## 🤖 Access the main stack\n\nYou might want to access the main stack later on in the lifecycle of the app. Till now we added our main stack in the `viewDidLoad()` but you may also declare it as a `lazy var`. So now you can acces it in the whoe view controller.\n\n```\n// MARK: - Views\n\nlazy var view0 = UIView(height: 300, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\nlazy var view1 = UIView(height: 300, backgroundColor: .systemBlue, staxDebugOptions: StaxDebugOptions())\nlazy var view2 = UIView(height: 300, backgroundColor: .systemRed, staxDebugOptions: StaxDebugOptions())\n\nlazy var ui =\n    VStack(\n        view0,\n        view1,\n        view2,\n        Spacer()\n    ).scrolls()\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    ui.layout(in: view).scroll(to: view1, axis: .vertical, offset: 50, delay: 2, animated: true)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00040.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\nNote: the `layout(in:)` has to be called in the `layoutViews()` \n\n## 👁 Show / Hide Views\n\nWe may show/hide views with an optional delay and animation. The default `delay` is `0`. Default animation is set to `true`. Can be set to any view that inherits from `UIView`.\n\n```\n// MARK: - Views\n\nlazy var view0 = UIView(height: 300, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\nlazy var view1 = UIView(height: 300, backgroundColor: .systemBlue, staxDebugOptions: StaxDebugOptions())\nlazy var view2 = UIView(height: 300, backgroundColor: .systemRed, staxDebugOptions: StaxDebugOptions())\n\nlazy var ui =\n    VStack(\n        view0,\n        view1,\n        view2,\n        Spacer()\n    ).scrolls()\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    ui.layout(in: view)\n    \n    view1.hide() // instant; you will not notice hiding the view\n    view1.show() // instant; you will not notice showing the view\n    view1.hide(after: 1)\n    view1.show(after: 2, animated: false)\n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00041.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n## 🧪 Change size of a stacked view\n\nYou may change a view size after the stack has been set. You may animate this change by adding the root view to the `animatedInRootView` property.\n\n```\n// MARK: - Views\n\nlazy var view0 = UIView(height: 300, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\nlazy var view1 = UIView(height: 300, backgroundColor: .systemBlue, staxDebugOptions: StaxDebugOptions())\nlazy var view2 = UIView(height: 300, backgroundColor: .systemRed, staxDebugOptions: StaxDebugOptions())\n\nlazy var ui =\n    VStack(\n        view0,\n        view1,\n        view2,\n        Spacer()\n    ).scrolls()\n\n// MARK: - Layout views\n\nfileprivate func layoutViews() {\n    ui.layout(in: view)\n    \n    DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1) {\n        self.view1.height(100/*, animatedInRootView: self.view*/)\n    }\n    \n}\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003eScreenshot\u003c/summary\u003e\n    \u003cimg src=\"../media/Sources/ReadMeAssets/Stax00042.png\" width=\"350px\"\u003e\n\u003c/details\u003e\n\n## 📱 Example\n\nHere is an in depth example view controller detailing all of the features of `Stax`\n\n```\nimport UIKit\nimport Stax\n\nclass ViewController: UIViewController {\n    \n    let customStaxDebugOptions = StaxDebugOptions(borderWidth: 5, cornerRadius: 0, color: .systemRed, lineWidth: 10, font: .italicSystemFont(ofSize: 30), textColor: .darkGray, textCornerRadius: 15)\n    \n    lazy var view1 = UIView(width: self.view.frame.size.width, backgroundColor: .systemYellow, staxDebugOptions: StaxDebugOptions())\n    lazy var view2 = UIView(backgroundColor: .systemTeal, staxDebugOptions: customStaxDebugOptions)\n    lazy var view3 = UIView(width: self.view.frame.size.width, backgroundColor: .systemRed)\n    let view4 = UIView(height: 600, backgroundColor: .systemRed, staxDebugOptions: StaxDebugOptions())\n    let view5 = UIView(square: 100, backgroundColor: .systemYellow, staxDebugOptions: StaxDebugOptions())\n    let view6 = UIView(square: 100, backgroundColor: .systemOrange, staxDebugOptions: StaxDebugOptions())\n    let view7 = UIView(square: 100, backgroundColor: .systemGray, staxDebugOptions: StaxDebugOptions())\n    let view8 = UIView(height: 150, backgroundColor: .systemPink, staxDebugOptions: StaxDebugOptions())\n    let view9 = UIView(square: 150, backgroundColor: .systemGray2, staxDebugOptions: StaxDebugOptions())\n    let view10 = UIView(square: 150, backgroundColor: .systemGray5, staxDebugOptions: StaxDebugOptions())\n    let view11 = UIView(height: 50, backgroundColor: .systemGray5, staxDebugOptions: StaxDebugOptionsType.dark)\n    let view12 = UIView(height: 50, backgroundColor: .systemGray4, staxDebugOptions: StaxDebugOptionsType.light)\n    let view13 = UIView(height: 50, backgroundColor: .systemGray3, staxDebugOptions: StaxDebugOptionsType.adaptive)\n    \n    lazy var ui =\n        VStack(\n            HStack(view1,\n                   view2.size(width: self.view.frame.size.width, height: 600),\n                   view3.debug()).scrolls(.horizontal).padding(.horizontal, 100).pages(),\n            HLine(),\n            VStack(\n                VStack(view4).background(.systemBlue).padding(.vertical, 200),\n                HStack(view9, VLine(30, .black, insets: UIEdgeInsets(top: 10, left: 0, bottom: 50, right: 0), withRoundedCorners: false), Spacer(), view10),\n                Line(.horizontal, 6, UIColor.black.withAlphaComponent(0.5), insets: UIEdgeInsets(top: 0, left: 48, bottom: 0, right: 48)),\n                view8,\n                VStack(view11, view12, view13).spacing(),\n                Divider(.vertical, 400).background(color: .systemOrange)\n            ).spacing(12).padding(.horizontal, 12)\n        ).spacing(12)\n        //        .axis(.vertical)\n        //        .alignment(.fill)\n        //        .distribution(.fill)\n        .scrolls(.vertical)\n        .background(.systemBackground)\n        .padding(.bottom, 50)\n    \n    fileprivate func layoutViews() {\n        \n        HStack(view5, view6)\n            .background(.systemBlue)\n            .scrolls(.horizontal)\n            .hidesScrollIndicator()\n            .scroll(to: view6, axis: .horizontal, delay: 2)\n            .scroll(.toLeft, delay: 3)\n            .center(inside: view4, size: CGSize(width: 100, height: 100), offset: CGPoint.right(100))\n\n        view7.center(in: view4, offset: CGPoint(x: -80, y: -160))\n\n        ui.layout(in: view, withSafeArea: false)\n            .scroll(to: view6, axis: .vertical, offset: 20, delay: 0.5)\n            .scroll(.toTop, delay: 5, animated: false)\n            .scroll(.toBottom, delay: 7)\n            .scroll(.toTop, delay: 11)\n\n        view11.hide(after: 9)\n        view11.show(after: 10, animated: false)\n        \n        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 13) {\n            self.view1.height(300, animatedInRootView: self.view)\n        }\n        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 15) {\n            self.view7.height(30, animatedInRootView: self.view)\n        }\n    }\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        // Do any additional setup after loading the view.\n        view.backgroundColor = .systemBackground\n        title = \"Stax\"\n        layoutViews()\n    }\n}\n\n```\n\n## ✍️ Contact\n\n\u003ca href=\"https://rebeloper.com/\"\u003erebeloper.com\u003c/a\u003e / \n\u003ca href=\"https://www.youtube.com/rebeloper/\"\u003eYouTube\u003c/a\u003e / \n\u003ca href=\"https://store.rebeloper.com/\"\u003eShop\u003c/a\u003e / \n\u003ca href=\"https://rebeloper.com/mentoring\"\u003eMentoring\u003c/a\u003e\n\n## 📃 License\n\nThe MIT License (MIT)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frebeloper%2Fstax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frebeloper%2Fstax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frebeloper%2Fstax/lists"}