mirror of
https://github.com/Dev1an/MsgPack.git
synced 2026-04-27 14:57:46 +00:00
Add example to readme
This commit is contained in:
parent
4c1c7937f5
commit
c57ed19c62
2 changed files with 11 additions and 2 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
//: Playground - noun: a place where people can play
|
//: Playground - noun: a place where people can play
|
||||||
|
|
||||||
import MsgPack
|
import MsgPack
|
||||||
import Foundation
|
|
||||||
|
|
||||||
let encoder = Encoder()
|
let encoder = Encoder()
|
||||||
|
|
||||||
|
|
|
||||||
12
README.md
12
README.md
|
|
@ -1,3 +1,13 @@
|
||||||
# Usage
|
# Usage
|
||||||
|
|
||||||
Take a look at the [playground](Playground.playground/Contents.swift)
|
```swift
|
||||||
|
import MsgPack
|
||||||
|
|
||||||
|
let encoder = Encoder()
|
||||||
|
try encoder.encode("Hello world")
|
||||||
|
try encoder.encode("😇")
|
||||||
|
try encoder.encode(0x0102030405060708)
|
||||||
|
try encoder.encode(["Some strings", "in an array"])
|
||||||
|
```
|
||||||
|
|
||||||
|
Take a look at the [playground](Playground.playground/Contents.swift) for more examples.
|
||||||
Loading…
Reference in a new issue