This simple spring latch can be used on its own or remixed into other models to add an easy snap-fit mechanism. https://youtu.be/Zlntza52REA...
3d model print parameters
All parts can be printed without supports.
Print the spring with enough perimeter lines that the flexible arms are solid.
Tested with PL...A and PETG.
Assembly
If attaching to a wall, nail or screw the spring into the wall surface. Make sure any hardware sits flush or nearly flush with the latch surface.
If attaching to a 3D printed object, use a strong glue. 3D Gloop is a good option - it will fuse the plastic together into a very strong bond.
Options
The spring comes in both tight and loose versions. If scaling down, use the the tight spring to keep as much strength as possible. If scaling up, stick with the looser spring.
If the spring feels too loose, try the “Frame with Tighter Clearance”, with has half the clearance of the original.