Loading examples/Example 1 - Hello World.playground/Contents.swift +7 −8 Original line number Diff line number Diff line //: Playground - noun: a place where people can play //: ## Example 1 - Hello World import Kinetic // Connect to a device // This creates a KineticSession against a KineticDevice //: First connect to a `KineticDevice` by creating a `KineticSession` let c = Kinetic.connect("localhost", port: 8123) // Write a key/value pair //: Write a key/value pair try c.put("hello", value: "world") // Read the value back //: Read the value back let x = try c.get("hello") // The Strings on the methods are just for convenience // the actual values are byte arrays ([UInt8]) //: The Strings on the methods are just for convenience //: the actual values are byte arrays `[UInt8]` print("Received: \(String.fromUtf8(x.value!))") examples/Example 1 - Hello World.playground/contents.xcplayground +1 −1 Original line number Diff line number Diff line <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <playground version='5.0' target-platform='osx' requires-full-environment='true'> <playground version='5.0' target-platform='osx' requires-full-environment='true' display-mode='raw'> <timeline fileName='timeline.xctimeline'/> </playground> No newline at end of file Loading
examples/Example 1 - Hello World.playground/Contents.swift +7 −8 Original line number Diff line number Diff line //: Playground - noun: a place where people can play //: ## Example 1 - Hello World import Kinetic // Connect to a device // This creates a KineticSession against a KineticDevice //: First connect to a `KineticDevice` by creating a `KineticSession` let c = Kinetic.connect("localhost", port: 8123) // Write a key/value pair //: Write a key/value pair try c.put("hello", value: "world") // Read the value back //: Read the value back let x = try c.get("hello") // The Strings on the methods are just for convenience // the actual values are byte arrays ([UInt8]) //: The Strings on the methods are just for convenience //: the actual values are byte arrays `[UInt8]` print("Received: \(String.fromUtf8(x.value!))")
examples/Example 1 - Hello World.playground/contents.xcplayground +1 −1 Original line number Diff line number Diff line <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <playground version='5.0' target-platform='osx' requires-full-environment='true'> <playground version='5.0' target-platform='osx' requires-full-environment='true' display-mode='raw'> <timeline fileName='timeline.xctimeline'/> </playground> No newline at end of file