Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jpsim/swiftxpc

XPC simplified for Swift. Deal with Swift and NS* objects instead of xpc_object_t.
https://github.com/jpsim/swiftxpc

Last synced: 3 days ago
JSON representation

XPC simplified for Swift. Deal with Swift and NS* objects instead of xpc_object_t.

Awesome Lists containing this project

README

        

# SwiftXPC

XPC simplified for Swift. Deal with Swift and NS* objects instead of
`xpc_object_t`.

## Usage

```swift
let swiftDict = [
"String": "string",
"Date": NSDate(),
"Data": NSData(),
"UInt64": UInt64(0),
"Int64": Int64(0),
"Double": 0.0,
"Bool": false,
"FileHandle": NSFileHandle(fileDescriptor: 0),
"Uuid": NSUUID(UUIDBytes: [UInt8](count: 16, repeatedValue: 0))
]
toXPC(swiftDict)
// { count = 9, contents =
// "Bool" => : false
// "Date" => Sun Mar 01 16:23:52 2015 PST (approx)
// "Uuid" => 00000000-0000-0000-0000-000000000000
// "Double" => : 0.000000
// "String" => { length = 6, contents = "string" }
// "Int64" => : 0
// "FileHandle" => { type = (invalid descriptor), path = /dev/ttys004 }
// "UInt64" => : 0
// "Data" => : { length = 0 bytes, contents = (nil)
//}>
```

## Credit

This project started as a Swift port of [@stevestreza](https://twitter.com/stevestreza)'s excellent
[XPCKit](https://github.com/stevestreza/XPCKit).

## License

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.