Yes you can do this. One of my project I had to do this. If you are using autolayout then you can not manually change your buttons frames. You can either have to disable autolayout, or modify the constraints programmatically. I followed the first one.
In your case, if you want the first button to take the position of the second one (which you are hiding) then take the frame of the second button and assign it to the first button.
Hope this helps. :)