Conditional view modifiers

SwiftUI provides a wide range of view modifiers which produce a new version of the original value when applied to a view or another view modifier. It's possible that when working with SwiftUI views, we may want to conditionally apply a view modifier based on certain conditions. In this post, Federico Zanetello shows us how we can use view extensions to handle such cases.