Can I have single file for all my hardcoded strings in project. let's say if I need particular String so that I can pick that string from that file.Overall can I have one single file for all my hardcoded strings.If yes which one file I required And how ca

Can I have single file for all my hardcoded strings in project. let's say if I need particular String so that I can pick that string from that file.Overall can I have one single file for all my hardcoded strings.If yes which one file I required And how can I use it to put Correct string at correct place

Replies

Can I have single file for all my hardcoded strings in project.

Are you talking about localised strings? Or other, general purpose strings?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

localised string

The standard approach for handling localised strings is to put all of the strings into a

Localizable.strings
file and then have you app access those strings via
NSLocalizedString
(a macro in Objective-C, a function in Swift). You can find info about this in the Internationalization and Localization Guide, and specifically the Separating User-Facing Text from Your Code section of that guide.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"