Swift’s @autoclosure attribute enables you to define an argument that automatically gets wrapped in a closure. It’s primarily used to defer execution of a (potentially expensive) expression to when it’s actually needed, rather than doing it directly when the argument is passed.
If you want to write a few less lines of code and keep up-to-date with the latest Core Data enhancements, read to learn more about NSPersistentContainer!