Created
October 9, 2024 19:52
-
-
Save christianselig/81f326db637efa708542129f08a85669 to your computer and use it in GitHub Desktop.
This file contains 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
struct MyWrapper { | |
let key: String | |
let value: any Codable | |
} | |
let point: CGPoint? = nil | |
let wrapper = MyWrapper(key: "point", value: point) | |
// ⚠️ Comparing non-optional type always returns false | |
// … but it IS nil :( | |
if wrapper.value == nil { | |
print("nil value") | |
} else { | |
print("continue…") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment