Released on 2021-06-15.
-
Inspection of a custom
ViewModifier
is now fully aligned with a customView
inspection and is devoid of some shortcomings. Your existing tests won't break, but if you choose to migrate to the new one - please refer to the guide for updated snippets for theclass Inspection
. Kudos to @gili-labs for playing an essential role in the research and development of this feature. -
A
View
that has applied customViewModifier
now inherits view and environment modifiers applied inside that customViewModifier
. See the example below:
struct MyModifier: ViewModifier {
func body(content: Self.Content) -> some View {
content
.padding(.top, 15)
}
}
let view = Text("Hi").modifier(MyModifier())
Before: Text
would report it has no padding
modifier applied.
Now: Text
reports the padding
applied from inside the MyModifier
.