Dev1an / MsgPack

MessagePack encoder for types conforming to Swift 4's Encodable protocol

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Usage

import MsgPack

// Encode standard types
let encoder = Encoder()
try encoder.encode("Hello world")
try encoder.encode("πŸ˜‡")
try encoder.encode(0x0102030405060708)
try encoder.encode(["Some strings", "in an array"])

// Encode custom types with Encodable πŸŽ‰
struct Point: Encodable {
  let x: Int
  let y: Int
}
try encoder.encode(Point(x: 90, y: 45))

Take a look at the playground for more examples.

About

MessagePack encoder for types conforming to Swift 4's Encodable protocol

License:MIT License


Languages

Language:Swift 99.0%Language:Objective-C 1.0%