sunshinejr / SwiftyUserDefaults

Modern Swift API for NSUserDefaults
http://radex.io/swift/nsuserdefaults/static
MIT License
4.85k stars 365 forks source link

Migration to 5.0 using SwiftPM fails #244

Open gabors opened 4 years ago

gabors commented 4 years ago

Second time trying to update my project to v 5. What a load of hurt.

project never finishes compiling, CPU spinning at 100%

Using only SPM dependencies in the projects, iOS, tvOS and Mac Catalyst. Xcode 11.4, Swift 5.1

sunshinejr commented 4 years ago

Hey @gabors, sorry that you had to go through this issue. Could you check #242 and #239 to see if it helps? There were quite a few changes to the library so you might have missed something. In case you're sure it's not it, we will try to investigate further!

OIO-WPK commented 4 years ago

Reporting same experience as @gabors: upgrading from 4.0 brought Xcode to its knees.

Manually updated all static let keys to var, etc. according to the guide but still did not help.

Xcode 11.4, Swift Packages

sunshinejr commented 4 years ago

@OIO-WPK did you change fetch/save from Defaults[.key] to Defaults[\.key]?

OIO-WPK commented 4 years ago

No, I updated them to Defaults.key(the IMHO cleaner syntax) which did clear the compiler's red flags and made me think it was ok (although compilation as a whole still could not finish).

OIO-WPK commented 4 years ago

BTW, thank you for your work, @sunshinejr!

I suspect this could be the issue also, and will try that (access via key path) once i switch back to that 5.0 branch. (Because of the need for Combine support and other packages' dependency, i am currently testing another framework.)