Skip to content

Swift code to convert any type to Data and initialise any type from Data

License

Notifications You must be signed in to change notification settings

raphaelwach/DataConvertible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DataConvertible

Purpose

Convert any Swift type to Data and initialize any Swift type from Data.

Usage

// T can be Data, String, Int, Int8, Int16, Int32, Int64, Float, Double, Date, Array, Set, Dictionary
let x: T

// Return the content of x as Data
x.binaryData

// Initialize an instance of type T from the content of a Data value
let y = T(binaryData: d) 

Author: Raphaël Wach

About

Swift code to convert any type to Data and initialise any type from Data

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages