Supporting Multiple iOS Versions in SwiftUI Without Turning Your Views Into a Mess

One of the nicest things about SwiftUI is how quickly it evolves. Every WWDC introduces new APIs, new modifiers, and little improvements that make building interfaces cleaner or require less code than before.

Naturally, you want to start using those improvements.

Then the compiler reminds you that your app still supports older versions of iOS.

'sectionIndexLabel' is only available in iOS 26.0 or newer