mobius Mobius 2019 SPb (22.05.2019)

Native data serialisation in iOS


We will talk about all the diversity of native iOS APIs for data serialisation (NSCoding, NSKeyedArchiver, Codable), compare them and discuss some non-trivial use cases.

In this talk, we’ll try to thoroughly treat the subject of data serialisation in iOS as of now.

We’ll start with what and why we serialise in mobile development, and discuss serialisation formats that are popular in iOS. We’ll consider several aspects of the problem, introducing specific use cases: data transfer, data storage, main serialisation formats.

We’ll discuss APIs existing way back in the pre-Swift era, with their benefits and drawbacks. Then we’ll move on to approach introduced in Swift 4, discuss why we even need this new approach, how it solves existing problems and why in the end we got what we got. We’ll compare these two approaches (old and new) in regards to performance and use cases.

We’ll also see interesting examples of using serialisation and problems that may appear in the development process.