ylliX - Online Advertising Network

AttributedString’s Codable format and what it has to do with Unicode

Here’s a simple AttributedString with some formatting: import Foundation let str = try! AttributedString( markdown: “Café **Sol**”, options: .init(interpretedSyntax: .inlineOnly) ) AttributedString is Codable. If your task was to design the encoding format for an attributed string, what would you come up with? Something like this seems reasonable (in JSON with comments): { “text”: “Café […]

Discover Codable on Swift by Sundell

Swift’s Codable protocol and its surrounding APIs provide a built-in way to serialize and deserialize Swift values to and and from various formats, including JSON and Plists. Arguably one of the most appealing aspects of Codable is its tight integration with the Swift compiler, which often makes it possible for the compiler to automatically generate […]