Swift macros used by Futured.
-
EnumIdentable
- Can be applied to enum to add
Identifiable
conformance. - Example:
@EnumIdentable enum Status { case loading case loaded(data: String) case error(Error) } // Status now conforms to Identifiable, Hashable, Equatable
- Can be applied to enum to add
-
ProxyMembers
- Exposes members of a property on the enclosing type by generating dynamic member lookup subscripts.
- Reduces boilerplate when you want to access nested properties directly.
- Example:
struct InnerData { var value: String } @dynamicMemberLookup struct Container { @ProxyMembers var inner: InnerData } var container = Container(inner: .init(value: "Hello")) print(container.value) // Prints "Hello" container.value = "World" // Direct property access works too
When using Swift package manager install using or add following line to your dependencies:
.package(url: "https://github.com/futuredapp/futured-macros", from: "0.1.0")
All contributions are welcome.
Current maintainer and main contributor is Šimon Šesták, [email protected].
FuturedMacros is available under the MIT license. See the LICENSE file for more information.