PopKernel
PopKernel

Reputation: 4270

Are Swift structs objects?

I know this is a basic question, but Structs in Swift are a lot more like objects than say, a C struct. Does that mean I should treat it as an object? Specifically I want to know if NSUserDefaults.objectForKey will work with a struct.

Upvotes: 0

Views: 222

Answers (1)

matt
matt

Reputation: 535304

Those are two different matters. Yes, Swift structs are very definitely objects - but that's within Swift. They are not the kind of object you can hand over to Objective-C!

Upvotes: 1

Related Questions