Sizing and flexibility
Identify fixed frames, rigid text, and image sizing that break as content, language, or Dynamic Type changes, with guidance to help your agent keep views flexible.
SwiftFairy Scroll
Build interfaces that adapt to any window size, device, and text size by sizing views flexibly, structuring scrolling content correctly, and choosing the right SwiftUI layout API for each job.
Identify fixed frames, rigid text, and image sizing that break as content, language, or Dynamic Type changes, with guidance to help your agent keep views flexible.
Help your agent choose a layout from the space available rather than the device or orientation, so screens adapt to resizable windows, split views, and folding devices.
Find GeometryReader used to size, divide, or track content, and give your agent the layout, scroll, and geometry APIs that replace each use.
Give your agent guidance on where scroll views, toolbars, search, and backgrounds belong in the hierarchy, so content scrolls beneath bars and fills the safe area correctly.
SwiftUI Layout & Resizability flags over 110 issues in your code. Each finding arrives at the line where the issue occurs, with the guidance and code example written for that case.
Your agent skips millions of tokens of reasoning and reads guidance only for the issues flagged.
Follows your view hierarchy across files and presentations, beyond single views and functions.
Built on our books and articles, and Natalia's work on Apple's SwiftUI team.
These examples show the patterns SwiftFairy flags and the guidance your agent can use to address them. Highlighted lines mark the code to review; each finding indicates whether the guidance is a requirement, recommendation, or consideration.
Consider
A GeometryReader that resizes a header from its frame in the scroll view changes layout on every frame of the scroll. The header's size, the scroll view's content size, and the positions of the views beneath it are recalculated as the user pulls, although the stretch is only a drawing effect.
// In a ScrollView:
GeometryReader { proxy in
let pull = max(
0,
proxy.frame(in: .scrollView).minY
)
HeaderImage()
.frame(height: 280 + pull)
.offset(y: -pull)
}
.frame(height: 280)
// On HeaderImage, in a ScrollView:
.frame(height: 280)
.visualEffect { effect, proxy in
let height = proxy.size.height
let pull = max(
0,
proxy.frame(in: .scrollView).minY
)
return effect.scaleEffect(
(height + pull) / height,
anchor: .bottom
)
}
Apply visualEffect to the header and scale it from the bottom anchor. The effect changes only how the header is drawn: it keeps one size in layout, so the scroll view's content size and the views beneath it stay where they are as the user scrolls.
Consider
A stack that places a header or footer beside a scroll view along its scrolling axis shortens the viewport. Content then clips at that boundary instead of scrolling beneath the adjacent view.
VStack(spacing: 0) {
ScrollView {
LazyVStack {
ForEach(items) { item in
ItemRow(item: item)
}
}
}
Text("Changes are saved automatically.")
.padding()
.frame(maxWidth: .infinity)
.background(.bar)
}
ScrollView {
LazyVStack {
ForEach(items) { item in
ItemRow(item: item)
}
}
}
.safeAreaInset(edge: .bottom, spacing: 0) {
Text("Changes are saved automatically.")
.padding()
.frame(maxWidth: .infinity)
.background(.bar)
}
Attach the footer through a safe-area inset so the scroll view retains its extent and reserves space for that content. Intentionally bounded scrolling regions, such as inset cards or independent panes, can keep their stack.
…and over 100 other issues.
Ask your agent to review a code change or a complete codebase with SwiftFairy. Your agent uses the findings and their accompanying code examples to resolve issues in your code.
How to use SwiftFairyActivate your free trial within the app at any time.
Choose lifetime access, a fixed term, or a subscription for this Scroll, or get all four together in a bundle.
Correct subtle bugs and performance issues in data flow, state ownership, and view updates by using SwiftUI as it was designed to be used.
Improve rendering and interaction performance by structuring charts and surrounding views to limit unnecessary updates and use Swift Charts APIs effectively.
Refine code for clarity, maintainability, and performance through idiomatic use of modern Swift APIs, including modern Swift concurrency and collection processing.