-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with Swift 3 #1
Comments
I haven't yet converted these files in Swift 3.0 Give me some time, I'll look into it. |
Thanks! Somehow the unarchiving seems to return nil .... |
Yes, I believe there's some change in the folder hierarchy or the way file URLs are handled in Swift 3.0 on a playground. Can you try archiving it into UserDefaults and unarchiving from it instead of a file? I'll work on conversion and release an update soon. |
Very strange. |
The same with classes seems to work |
Yeah, I have trouble with conversion also specifically with the the stringappendingstring. Can you also show how to do this with an array of movie objects? |
Hmmm, no idea what is wrong ... |
Okay, I got the ArchivingSwiftStructures3.playground working in Swift 3. The file's been attached below. I suspect the problem came up because NSKeyedArchiver and UserDefaults class now use 'Any' type instead of 'AnyObject'. This is causing havoc with class type objects. I'll update the repo with Swift 3 files soon. See if what I've attached suffices for now. |
Works perfect! Thanks a lot! |
Hi! Do you have any idea, how to solve this? |
If you're using the 3rd type of archiving and unarchiving structs or array of structs, you need to first conform that struct to Dictionariable protocol
Write an extension on NSPoibt or CGPoibt and make it conform to Dictionariable by implementing the two required methods.
Let me know if that helps.
On Mon, Nov 28, 2016 at 7:33 PM, Fritz <[email protected]> wrote:
Hi!
Just found one problem (Maybe I'm doing anything wrong). I tried to store an array of structs of NSPoints.
But it fails with "Argument type '[Points]' does not conform to expected type 'Dictionariable'"
MyArchivePointsPlayground.playground.zip [https://github.com/vishalvshekkar/ArchivingSwiftStructures/files/616455/MyArchivePointsPlayground.playground.zip]
Do you have any idea, how to solve this?
Thanks
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub [#1 (comment)] , or mute the thread [https://github.com/notifications/unsubscribe-auth/ANIhYmIcFNNWBRvQXFgXrNJ3gUXaXrgsks5rCt9GgaJpZM4KupeX] .
|
Thanks a lot this helped. |
Awesome. |
I updated to Swift 3 and after conversion it looks like I cannot read the archived struct.
Any idea what I did wrong?
The text was updated successfully, but these errors were encountered: