trilemma-dev / SecureXPC

A simple and secure XPC framework for Swift
MIT License
77 stars 15 forks source link

More efficient representations of `Data` and some array types #113

Closed jakaplan closed 2 years ago

jakaplan commented 2 years ago

Resolves #7 by directly encoding/decoding Data to its XPC equivalent when it's the route reply or message type or enables an equally efficient encoding via an optional property wrapper.

The same is done for arrays of Bool and all standard numeric types.

jakaplan commented 2 years ago

@amomchilov for your review if you'd like. Due to how encoding/decoding works I'm pretty sure there's no way to just automatically make this work in all cases without the API user modifying their code, so this is the best I could come up with. For the most basic case it will "just work" otherwise a property wrapper needs to be used which ought to be rather easy for the developer to do.

jakaplan commented 2 years ago

I'm going to merge this in to continue work on some other changes, but always open to feedback at a later date