在view的代码中使用print的方法。
方法1:
extension View {
func debugPrint(_ value:Any) -> some View {
#if DEBUG
print(value)
#endif
return self
}
}
方法2:
let _ = print(value)
在view的代码中使用print的方法。
方法1:
extension View {
func debugPrint(_ value:Any) -> some View {
#if DEBUG
print(value)
#endif
return self
}
}
方法2:
let _ = print(value)