DebugFrame 2.2.1

DebugFrame 2.2.1

Vladislav Shkodich维护。



  • 撰写的
  • Vladislav Shkodich

DebugFrame

DebugFrame库是一个简单而强大的工具,可以帮助您轻松构建SwiftUI视图。

  • 在实际应用中,它是一个可以对任何SwiftUI视图应用的修饰符。它为您视图添加一个覆盖层,显示视图周围的边框以及视图的原点和大小信息。这在识别布局问题时非常有帮助,例如视图过大或过小,或者视图位置不正确。

  • 另一个功能是针对View的debugBackground扩展,每次重新渲染时都会随机选择颜色。

集成

使用SPM进行设置

DebugFramehttps://github.com/vdshko/DebugFrame

使用CocoaPods进行设置

pod 'DebugFrame'

.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.

.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.