SwiftUIViewTypeInspection provides helpers methods on SwiftUI.View to inspect its real concrete type.
Print its real concrete type representation to the standard output stream.
Example:
import SwiftUIViewTypeInspection
struct MyView: View {
var body: some View {
HStack {
Text("Hello, ")
Text("world!")
}
.inspectType() // prints "HStack<TupleView<(Text, Text)>>"
}
}
Store its real concrete type representation to the target stream.
Tip: the String
type conforms TextOutputStream
.
Example:
import SwiftUIViewTypeInspection
var output: String = ""
struct MyView: View {
var body: some View {
HStack {
Text("Hello, ")
Text("world!")
}
.inspectType(to: &output) // stores "HStack<TupleView<(Text, Text)>>\n"
}
}
Thinking in SwiftUI, page 10, 2020-12-15 ver.
link |
Stars: 2 |
Last commit: 1 year ago |
Initial release.
Full Changelog: https://github.com/getogrand/SwiftUIViewTypeInspection/commits/0.1.0
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics