Skip to content

Instantly share code, notes, and snippets.

@christianselig
Created October 9, 2024 21:18
Show Gist options
  • Save christianselig/b5658dd070b40e115eb5348fa00b1e2d to your computer and use it in GitHub Desktop.
Save christianselig/b5658dd070b40e115eb5348fa00b1e2d to your computer and use it in GitHub Desktop.
func store<T: Codable>(values: [String: T]) {
// How do I check if *this* if nil?
let myVal = values["hello"]
print(myVal) // Optional(nil)
print(myVal == nil) // false
}
let point1: CGPoint? = nil
store(values: ["hello": point1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment