This cannot be done if you want to release your app on the App Store. It will be rejected; the regulations disallow repurposing the hardware buttons for any other function.
As a specific example, some camera apps have been refused for using volume-up as a camera shutter:
Your application cannot be added to the App Store because it uses
iPhone volume buttons in a non-standard way, potentially resulting in
user confusion. Changing the behavior of iPhone external hardware
buttons is a violation of the iPhone Developer Program License
Agreement. Applications must adhere to the iPhone Human Interface
Guidelines as outlined in the iPhone Developer Program License
Agreement section 3.3.7
http://petapixel.com/2010/08/13/camera-shuttered-from-app-store-for-hidden-banned-feature/
EDIT: since you don't need to work on App Store, I looked for a solution for you and found an older answer you could use. iOS use the volume buttons as input