What are Lenses? Great explanation by @mbrandonw
Files:
input.swift
- sample structs for which we want helpers to be generatedlens.stencil
- sourcery template to generate lenses helpersoutput.swift
- sample lenses helpers generatedzLens.swift
- simple implementation of lenses, so you can play with it
Hints:
- Usually you want to generate helpers only for certain structs in your project. To limit scope of sourcery changes, keep your relevant structs under one directory and just point sourcery to that directory instead of whole project.