A collection of Swift macros to reduce boilerplate for building applications.
Package dependency:
.package(url: "https://github.com/appbiotic/appbiotic-macros-swift", exact: "0.2.0")
Target dependency:
.product(name: "AppbioticMacros", package: "appbiotic-macros-swift")
import AppbioticMacros
import NotificationCenter
@NotificationNames(prefix: "com.example.app.")
public enum AppEvent {
case startedSomething
case stoppedSomething
}
Expands to:
import AppbioticMacros
import NotificationCenter
public enum AppEvent {
case startedSomething
case stoppedSomething
public var notificationName: Notification.Name {
get {
switch self {
case .startedService:
return Notification.Name("com.example.app.startedSomething")
case .stoppedService:
return Notification.Name("com.example.app.startedSomething")
}
}
}
}
This software package is provided on an "as-is" basis. Community-based support is available in discussions. Filed issues may be renamed, split, deduplicated, or moved to a discussion, for organizational clarity purposes.