![]() If you would like to read more about the new Result type in Swift 5.0, I would recommend you to read this article by Paul Hudson or go through the slides from Tjeerd in ‘t Veen who did a talk at Appdevcon 2019.ĪBI stability is a topic on its own. However, if you want to speed up your migration, you can also just set the type to Swift.Error. Being a good citizen you should try to make this error type specific to what you expect. The Swift 5.0 Result variant also requires you to define an expected error type. It’s likely that your current Result enum only defined a type for the success case. It’s good to point out that the built-in Swift 5 Result type is friends with your existing Result enums and can live together. ![]() Therefore, you should focus on the defined Result enums in your own project and frameworks by replacing that with the built-in Swift version. However, to replace these from your dependencies, you’re dependent on code changes in the external framework. ![]() ![]() This could mean that you’ve got quite a view enums which are not needed anymore. A lot of frameworks have included a Result type in their code. It does not take into account the new Result type which is now included in the Swift standard library. The Xcode converter only executes basic code changes. If you’re using Travis, Jenkins or any other CI platform you need to upgrade Xcode there as well. Your test will cover these updates directly as well, which can be a win-win. If you’re planning to do a full intensive test of your app after this migration, it might be worth to directly update your dependencies as well. At WeTransfer we’re often checking in with our dependencies to see whether an update is available already. Although I would like to encourage you to do the migration and submit a pull request yourself, you probably have to wait a bit till the project owners did it themselves. However, it’s likely that not all your dependencies are up to date already. A lot of the bigger open source projects like Alamofire and Moya started working on a Swift 5.0 version already. Most likely, you’ve got some Swift dependencies you need to update. Automated migration to Swift 5.0 using the built-in Xcode converter Updating dependencies
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |