Generic Swift collections for objects and callbacks