Converting between String and Data without optionalsBasics article available: Strings
While Swift offers many APIs for converting between
String, these two let us do so without any optionals — usually resulting in simpler code:
// String -> Data let data = Data("Hello, world!".utf8) // Data -> String let string = String(decoding: data, as: UTF8.self)
My favorite continuous integration service. Automatically build, test and distribute your app on every single commit that you make. Bitrise is fast, rock solid, and takes just a few minutes to set up. Try it for free, and see how it can improve your team’s workflow.