How do I make my volume buttons make my camera zoom in and out

So I’m new to swift, and I want to create a custom camera app that can zoom in and out by simply pressing the volume buttons. I have the camera part down, but I have no idea how to do the zoom part. I can’t find it anywhere and I just really want to use it. If someone could tell me how to do this that would be amazing, also could you tell me where to put it and stuff, if it even matters. If this has any part in it, this is the video I used to make the camera: https://youtu.be/EC1pZOXctV0