Last active
June 9, 2021 16:32
-
-
Save marybnq/f765d44cff15ea530e7ee09b0497d020 to your computer and use it in GitHub Desktop.
A String extension to quickly create NSLocalizedString in Swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// LocalizedStrings.swift | |
// Localization | |
// | |
// Created by Federica Benacquista on 09/06/21. | |
// | |
import UIKit | |
extension String{ | |
/** | |
@return NSLocalizedString returns an NSLocalizedString with both content and comment set to the string you call this on | |
*/ | |
var localize: String { | |
return NSLocalizedString(self, comment: self) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment