Write, review, or improve UIKit code following best practices for view controller lifecycle, Auto Layout, collection views, navigation, animation, memory management, and modern iOS 18–26 APIs. Use when building new UIKit features, refactoring existing views or view controllers, reviewing code quality, adopting modern UIKit patterns (diffable data sources, compositional layout, cell configuration), or bridging UIKit with SwiftUI. Does not cover SwiftUI-only code.
96
100%
Does it follow best practices?
Impact
96%
1.23xAverage score across 9 eval scenarios
Passed
No known issues
{
"context": "Tests whether the agent correctly places UIViewController lifecycle work in the right methods (viewIsAppearing for geometry-dependent scroll, viewDidLoad for setup), follows constraint best practices (activate[], no remove/recreate, identifiers, priority ≤999), and animates layout changes correctly (constant update + layoutIfNeeded on superview).",
"type": "weighted_checklist",
"checklist": [
{
"name": "scrollToItem in viewIsAppearing",
"description": "The scrollToItem(at:at:animated:) call (or equivalent scroll-to-selected logic) is inside viewIsAppearing(_:), NOT in viewDidLoad or viewWillAppear",
"max_score": 12
},
{
"name": "Setup in viewDidLoad",
"description": "Subview creation, addSubview calls, constraint setup, and data source/delegate assignment are all in viewDidLoad — NOT in viewIsAppearing or viewWillAppear",
"max_score": 10
},
{
"name": "super called in all lifecycle overrides",
"description": "Every overridden lifecycle method (viewDidLoad, viewIsAppearing, viewWillAppear, viewDidLayoutSubviews, etc.) calls super before or as part of its body",
"max_score": 8
},
{
"name": "translatesAutoresizingMaskIntoConstraints = false",
"description": "Every programmatically created view has translatesAutoresizingMaskIntoConstraints set to false before constraints are added",
"max_score": 8
},
{
"name": "NSLayoutConstraint.activate used",
"description": "Constraints are activated using NSLayoutConstraint.activate([...]) — NOT via individual constraint.isActive = true calls",
"max_score": 8
},
{
"name": "Header constraint stored and reused",
"description": "The collapsible header height (or equivalent) constraint is stored as a property and its .constant is modified to toggle states — the constraint is NOT removed and recreated",
"max_score": 12
},
{
"name": "Animation uses layoutIfNeeded on superview",
"description": "The expand/collapse animation calls layoutIfNeeded() inside a UIView.animate block on the superview (or view) — NOT by deactivating/reactivating constraints inside the animation block",
"max_score": 10
},
{
"name": "Runtime priority ≤ 999",
"description": "Any constraint whose priority is changed at runtime uses a value ≤ 999 (e.g., UILayoutPriority(999) or .defaultHigh) — NOT UILayoutPriority.required (1000)",
"max_score": 8
},
{
"name": "Constraint identifiers set",
"description": "At least one key constraint (e.g., the header height constraint or a major layout anchor) has its .identifier property set to a descriptive string",
"max_score": 10
},
{
"name": "viewDidLayoutSubviews limited to layer work",
"description": "If viewDidLayoutSubviews is overridden, it contains ONLY lightweight layer adjustments (e.g., cornerRadius, shadowPath) and does NOT set up constraints or subviews",
"max_score": 7
},
{
"name": "No geometry work in viewWillAppear",
"description": "viewWillAppear does NOT contain any geometry-dependent work such as scrolling, frame reading, or layout-dependent calculations",
"max_score": 7
}
]
}