Platform Conditional Modifiers in SwiftUI v3

Published June 9, 2021

SwiftUI version 3 (coming in iOS 15 & macOS Monterey) has brought with it many nice features, including the ability to use #if conditional statements for postfix member expressions and modifiers:

Text("Title")
#if os(iOS)
    .font(.title)
#else
    .font(.headline)
#endif