Simple guide to Automatic grammar agreement in Swift

<p>Bet every iOS developer had this embarrassing bug reported at least once in their career and had to deploy a simple fix.</p> <pre> count == 1 ? &quot;\(count) Apple&quot; : &quot;\(count) Apples&quot;</pre> <p>What if there was a more elegant way to handle this? After all, we iOS developers would want our code to look sleek and clean.</p> <h2>Introducing&nbsp;<strong>Automatic Grammar Agreement</strong></h2> <p>Using Automatic Grammar Agreement you no longer need to go running around to your localisation files to add plurals wherever necessary in the app. Simply make the following modification.</p> <pre> &quot;^[\(count) Apple](inflect: true)&quot;</pre> <p>Let&rsquo;s see the following code with SwiftUI in action.</p> <p><a href="https://isnihal.medium.com/simple-guide-to-automatic-grammar-agreement-in-swift-19f4f1122e1a"><strong>Learn More</strong></a></p>