user6485277
user6485277

Reputation:

New Core Data in Swift 3

New Swift 3 presents replacements for types with prefix "NS" with types "NS"less. One of them - NSData becomes Data. So I see that in Core Data, type "Binary Data" equals to type NSData. So for example if my struct has var with "Data" type, I has to make it NSData.

Questions:

1) Am I right?

2) How to make NSData to be Data. When I do this:

var photoData = Data(dataForTable[0].userPhoto),

I receive this: Cannot subscript a value of type "inout Array"

Upvotes: 2

Views: 585

Answers (1)

Daniel Dunbar
Daniel Dunbar

Reputation: 3615

You can use as Data to bridge an NSData instance to Data.

Upvotes: 2

Related Questions