ArrangeUI is a lightweight UIKit wrapper around the Arrange layout engine.
The package focuses on view/layout primitives only:
HStackViewVStackViewZStackViewFrameViewPaddingViewOffsetViewBackgroundViewSizeViewSpacerViewBoundsClampedViewSafeAreaClampedView
The goal is to make SwiftUI-like layout composition available in UIKit, while staying fully UIView-based.
ArrangeUI currently handles:
- layout wrappers
- sizing behavior (
intrinsicContentSize,sizeThatFits) - frame placement in
layoutSubviews - small UIView convenience APIs like
padding,offset,background,frame, andsized
Add ArrangeUI to your Swift Package dependencies:
dependencies: [
.package(url: "https://github.com/danielinoa/ArrangeUI.git", branch: "main")
]Then add "ArrangeUI" to your target dependencies.
import UIKit
import ArrangeUI
let title = UILabel()
title.text = "ArrangeUI"
let subtitle = UILabel()
subtitle.text = "UIKit + Arrange"
let content = VStackView(alignment: .leading, spacing: 8)
content.addSubview(title)
content.addSubview(subtitle)
let card = content
.padding(16)
.background(UIView())
.frame(maximumWidth: 320, alignment: .leading)- Platform target: iOS 13+
xcodebuildis the recommended way to validate iOS builds from CLI.
Issues and PRs are welcome, especially around:
- layout correctness and edge cases
- API ergonomics for UIKit composition
- docs and examples
ArrangeUI is primarily the work of Daniel Inoa.