Point-Free Pointers
Read post

Introducing @DependencyEntry

The swift-dependencies library now ships a new `@DependencyEntry` macro that dramatically reduces boilerplate when registering dependencies. Inspired by SwiftUI's `@Entry` macro, it handles the library's three-environment model (live, preview, test) through a concise API: the property initializer becomes the `testValue`, while `liveValue:` and `previewValue:` can be passed as macro arguments. Omitting `liveValue` keeps the dependency conforming only to `TestDependencyKey`, preserving the ability to separate interface from live implementation for modular codebases. Available in Dependencies version 1.13 via the `DependenciesMacros` module.

    #swift#swiftui#dependency-injection
Jun 17•4m read time•From pointfree.co
Post cover image
13.8K Impressions
Point-Free Pointers's image
Point-Free Pointers

PointFree's platform is a resource for Swift developers, offering insights into functional programmi...

16 Followers

•

69 Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard