What's New

Proxy 0.0.1

2020-03-15T20:01:57Z

Initial release

Proxy Swift

Proxy

Swift package that implements mutable and immutable proxy objects through @dynamicMemberLookup, and lazy proxy-based object builders (Partials).

TL;DR

struct Foo {
  let constant = 1337
  var label = "Initial"
  var number = 42
}

var immutableProxy = ImmutableProxyRef(of: Foo())
immutableProxy.label // "Initial"
immutableProxy.number // 42

var mutableProxy = ProxyRef(of: Foo())
mutableProxy.label // "Initial"
mutableProxy.label = "New"
mutableProxy.label // "New"

var partial = Partial(createInstanceClosure: { Foo() })
partial.label = "Bar"
partial.number = 1
let obj = partial.build()
obj.label // "Bar"
obj.number // 1

Description

  • Swift Tools 5.1.0

Dependencies

  • None
Last updated: Sun Jan 24 2021 01:12:12 GMT-0500 (GMT-05:00)