0

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.

PopKernel
  • 4,110
  • 5
  • 29
  • 51

1 Answers1

1

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!

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • 1
    It happens that I've just written a Swift tutorial that has a section on this very subject: http://www.apeth.com/swiftBook/apa.html#_objective_c_objects_and_swift_objects – matt Jan 13 '15 at 01:30