Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/jpsim/swiftxpc
- Owner: jpsim
- Created: 2014-10-30T00:45:16.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-07-24T23:10:35.000Z (over 7 years ago)
- Last Synced: 2024-12-29T00:33:13.483Z (12 days ago)
- Language: Swift
- Homepage:
- Size: 36.1 KB
- Stars: 63
- Watchers: 6
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 athttp://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.