Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 1.72 KB

README.md

File metadata and controls

43 lines (32 loc) · 1.72 KB

DebugFrame

DebugFrame lib is a simple and powerful tool that can help you build your SwiftUI views easily.

  • Under the hood, it's a modifier that can be applied to any SwiftUI view. It adds an overlay to your view, which displays a border around the view and frame information, such as the view’s origin and size. This can be incredibly helpful when identifying layout issues, such as views that are too large or small or views that are positioned incorrectly.

  • Another feature is a debugBackground extension for the View, with a randomly picked Color each re-render time.

Integration

Setup with SPM:

DebugFrame or https://github.com/vdshko/DebugFrame

Setup with CocoaPods:

pod 'DebugFrame'

Usage of .debugFrame()

VStack {
  title
    .debugFrame()
  Spacer()
  rectangles
    .debugFrame(color: .black)
  Spacer()
}
.debugFrame(color: .black, .size)

Screenshot of an app using DebugFrame. There are a few colored rectangles, and each one has a dotted line overlay and text showing the width and height.

Usage of .debugBackground()

VStack {
  title
    .debugBackground()
  Spacer()
}
Screenshot of an app using DebugFrame. There is a title text with a randomly colored background rectangle version 1. Screenshot of an app using DebugFrame. There is a title text with a randomly colored background rectangle version 2.