(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| func encode<T>(var value: T) -> NSData { | |
| return withUnsafePointer(&value) { p in | |
| NSData(bytes: p, length: sizeofValue(value)) | |
| } | |
| } | |
| func decode<T>(data: NSData) -> T { | |
| let pointer = UnsafeMutablePointer<T>.alloc(sizeof(T.Type)) | |
| data.getBytes(pointer) | |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.