Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Aeastr/Loupe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Loupe

Loupe

A SwiftUI debugging toolkit for visualizing renders, layouts, and measurements.


Overview

Loupe provides runtime debugging tools for SwiftUI applications. Visualize render cycles, inspect layout bounds, track positions, and overlay precision grids—all with minimal setup.

Read the full documentation →


Installation

Swift Package Manager

https://github.com/Aeastr/Loupe.git

Add via Xcode: File → Add Packages and paste the URL above.


Quick Start

Render Debugging

See when views re-render or re-compute:

import Loupe

Text("Count: \(count)")
    .debugRender()      // Shows re-renders with colored backgrounds
    .debugCompute()     // Shows re-computations with red flashes

Learn more about render debugging →


Layout Inspection

Display bounds, safe area insets, and dimensions:

ZStack {
    Color.blue
        .overlay {
            VisualLayoutGuide("Content Area")
        }
}

Enable dragging and persistence:

VisualLayoutGuide("Debug View")
    .visualLayoutGuideInteractions(dragEnabled: true, persistenceEnabled: true)

Learn more about layout guides →


Position Tracking

Monitor coordinates with draggable overlays:

DraggablePositionView("Tracker")
    .draggablePositionViewInteractions(dragEnabled: true)

Learn more about position tracking →


Grid Overlays

Add precision alignment grids:

VisualGridGuide("8pt Grid", squareSize: 8, fit: .exact)
    .ignoresSafeArea()

Learn more about grid guides →


Features

Render Debugging

  • .debugRender() - Visualize re-renders
  • .debugCompute() - Visualize re-computations
  • RenderCheck - Batch debugging wrapper

Layout Inspection

  • VisualLayoutGuide - Bounds, insets, and dimensions
  • DraggablePositionView - Coordinate tracking
  • VisualGridGuide - Alignment grids

Container Shapes (iOS 26+)

  • VisualCornerInsetGuide - ConcentricRectangle visualization

View all features →


Production Builds

All debugging tools are conditionally compiled with #if DEBUG. They are automatically excluded from release builds—no manual cleanup required.


Documentation


License

MIT License. See LICENSE for details.


by Aether