Enhanced SwiftUI debugging with structured view insights and render tracking.
import SwiftUI
import SwiftUIDebugScan
struct FeatureRootView: View {
var body: some View {
List {
FeatureLeafView()
FeatureLeafView()
FeatureLeafView()
}
.debugScan("FeatureRootView")
}
}Console Output:
🧩 [MainView]
• 📂 file: FeatureRootView.swift
• 📚 module: Feature
• 🎨 redraws: 1
• ⏱️ timestamp: 2025-07-21 14:05:40 +0000
- View Metadata: Track file, module, and render counts
- Debug Complex UIs: Essential for large, server-driven applications
- Performance Insights: Identify over-rendering and optimization opportunities
- Targeted Debugging: Focus on root views without log noise
✅ Apply to root views:
NavigationView {
HomeScreen()
}.debugScan("HomeNavigation")❌ Avoid on leaf views:
// Don't do this - too much noise
Text("Button").debugScan("ButtonText")💡 Recommended targets:
- Screen root views
- Major container views
- Complex custom components
- Views with performance concerns
Set SWIFTUI_DEBUG_SCAN_VERBOSE=1 for detailed diagnostics:
- 🧵 Call stack and thread info
- 💾 Memory and CPU usage
- ⏱️ Performance timing
- 📊 System metrics
Swift Package Manager:
dependencies: [
.package(url: "https://github.com/ConsultingMD/swift-ui-debug-scan", from: "0.1.0")
]Xcode: File > Add Packages → Enter URL above
Contributions welcome! See CONTRIBUTING.md for guidelines.
Quick fixes: Fork → Change → Test → PR
New features: Open issue first to discuss