ListableProperties

0.1.0

ListableProperties macro allows to list all the properties of a struct, class and other types
neothXT/ListableProperties

What's New

Release 0.1.0

2023-12-21T11:47:04Z

ListableProperties

ListableProperties macro allows to list all the properties of a struct, class and other types by adding static getProperties() func to it. All you need to do is to add @ListableProperties to your model.

Installation

ListableProperties is currently available only via SPM (Swift Package Manager)

Basic Usage

@ListableProperties
struct Model {
    let firstProperty: String
    let secondProperty: Int
    var thirdProperty: Bool
}

print(Model.getProperties()) // This will return ["firstProperty", "secondProperty", "thirdProperty"]

And that's it. Enjoy :)

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

Last updated: Sat Oct 19 2024 09:41:51 GMT-0900 (Hawaii-Aleutian Daylight Time)