I'm glad to share UIInspector, a debugging tool It's designed as a lightweight alternative to Xcode's built-in inspector tools.
What is UIInspector?
UIInspector is a runtime debugging tool that overlays directly on top of your iOS app, allowing you to inspect UI elements, measure dimensions, pick colors, and visualize view hierarchies without switching back and forth between your app and Xcode.
Why I Built This
- Debugging layout directly in XCode preview without needing to run the app
- Design reviews and testing
- As a simple alternative to Xcode's built-in inspector and other UI debugging tools
Key Features
Dimension Measurement: Measure distances between any points
View Hierarchy Visualization: See your app's view hierarchy in a 3D
Color Picker: Extract exact colors from any pixel in your interface
Property Inspector: View comprehensive information about UI components
Grid Overlay: Enable alignment grids for pixel-perfect layouts
Quick Usage Example
import SwiftUIInspector
// Present the inspector over your current view
UIInspectorController.present()
// Or customize it
UIInspectorController.present { inspector in
inspector.tintColor = .systemBlue
inspector.customInfoView = { view in
AnyView(Text("Custom info for \(type(of: view))"))
}
}
For SwiftUI previews:
#Preview {
MyView()
.previewInspector() // Adds inspector button to preview
}
Repository: GitHub - dankinsoid/swift-uiinspector: Runtime ui inspector