Skip to content

Latest commit

 

History

History
67 lines (45 loc) · 1.96 KB

README.md

File metadata and controls

67 lines (45 loc) · 1.96 KB

MacroStore 🚀

Swift 5.0 License Platform

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 )

@AssociatedValue

It helps you simply extract Associated Values from enum

Usage

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?

Installation

Swift Package Manager

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")
]

Note :

You can only use this repository with Xcode 15 and higher version

Author

✨If this project reduce your development time please Give me a STAR✨

Alkin Cakiralar, [email protected]

License

MacroStore is available under the MIT license. See the LICENSE file for more info.