Bunch of Swift Macros
I'll gather plenty of macros which can be helpfull for swift development to this repository
Here are the existing and further macros that you can integrate with in your project
- @AssociatedValue
- @DummyData ( Developing )
It helps you simply extract Associated Values from enum
Define @AssociatedValue macros to your enum and extract the cases appended "value" keyword as below
@AssociatedValue
enum ViewModelState {
case loading
case loaded(data: Data, externalData: ExternalData)
case failure(error: String)
case empty(EmptyState)
}
let _ = _viewModelState.emptyValue // EmptyState?
let _ = _viewModelState.loadedValue?.0 // Data?
let _ = _viewModelState.loadedValue?.1 // ExternalData?
let _ = _viewModelState.failureValue // String?
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift
compiler.
Once you have your Swift package set up, adding MacroStore as a dependency is as easy as adding it to the dependencies
value of your Package.swift
.
dependencies: [
.package(url: "https://github.com/alkincakiralar1996/MacroStore.git", branch: "main")
]
You can only use this repository with Xcode 15 and higher version
Alkin Cakiralar, [email protected]
MacroStore is available under the MIT license. See the LICENSE file for more info.