Avatar ·

Global Constants in Swift: Best Practices and Code Organization

Hello everyone. I'm a beginner iOS developer transitioning from Objective-C to Swift. In Objective-C, I was used to creating global constants using `#define` macros or `extern const`. For example, I had a `Constants.h` file: ```objective-c extern NSString *const kAPIBaseURL; extern NSInteger const kMaxRetryCount; ``` Now in Swift, I can't use `#define` and I don't understand how to properly organize storing global constants. I've seen several approaches: 1. Create a struct with static properties. 2. Use an enum without cases. 3. Simply declare let variables at the file level. What bothers me is that there's no single standard in Swift. For example, I want to store the server URL, API keys, animation settings, and request limits. Which approach is considered correct? Do I need to create a separate