You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For string values, the string associated with the specified key; for number values, the string value of the number. Returns nil if the default does not exist or is not a string or number value
Which makes the macOS behaviour correct
The text was updated successfully, but these errors were encountered:
Environment
Swift 5.4
Additional Detail from JIRA
md5: 3414fbf73d52305cd8edd91052896a16
Issue Description:
import Foundation
UserDefaults.standard.set(2, forKey: "a")
print(UserDefaults.standard.integer(forKey: "a"))
print(UserDefaults.standard.string(forKey: "a") ?? "it is nil")
On Linux it outputs:
2
it is nil
On macOS:
2
2
The documentation states:
Which makes the macOS behaviour correct
The text was updated successfully, but these errors were encountered: