Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[resources] Fix regionCode crash on iOS before 17 #4473

Merged
merged 1 commit into from Mar 12, 2024

Conversation

terrakok
Copy link
Collaborator

The regionCode API

NSLocale.currentLocale().regionCode

was published in iOS 17: https://developer.apple.com/documentation/foundation/nslocale/4172868-regioncode?language=objc

to make it works on all iOS versions we have to use:

NSLocale.currentLocale().objectForKey(NSLocaleCountryCode) as? String

fixes #4469

@terrakok terrakok requested a review from igordmn March 12, 2024 13:54
@terrakok terrakok merged commit e7f1a6c into master Mar 12, 2024
@terrakok terrakok deleted the k.tskh/fix-ios-env branch March 12, 2024 14:07
igordmn pushed a commit that referenced this pull request Mar 12, 2024
The regionCode API
```
NSLocale.currentLocale().regionCode
```
was published in iOS 17:
https://developer.apple.com/documentation/foundation/nslocale/4172868-regioncode?language=objc

to make it works on all iOS versions we have to use:
```
NSLocale.currentLocale().objectForKey(NSLocaleCountryCode) as? String
```

fixes #4469
@igordmn igordmn added the changelog1.6.1 Temporary label for 1.6.1 changelog (will be removed) label Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog1.6.1 Temporary label for 1.6.1 changelog (will be removed)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1.6.0 crash on iOS 16 and below
3 participants