How do I set up localization and multiple languages on iOS using Swift?

Setting up localization and supporting multiple languages in an iOS app using Swift is essential for reaching a broader audience. This involves creating localized resources such as strings, images, and more to adapt the app's content based on the user's selected language.

Example of Setting Up Localization

1. **Add Localizable Strings**: Create a file named Localizable.strings for each language you want to support. For example, you can have Localizable.strings for English and another for Spanish.

2. **Update Info.plist**: Ensure your app supports multiple languages by including the languages in your Info.plist file.

3. **Access Localized Strings in Code**:


// Accessing localized strings in Swift
let greeting = NSLocalizedString("greeting", comment: "A friendly greeting")
print(greeting)
    

localization multiple languages iOS Swift Localizable.strings NSLocalizedString