0

As an example, I have 5 IBActions declared. When I push one, I want the other 4 to fall down off the screen. Any idea how to do this? Would I define a translation for each other IBAction??

Taylor
  • 75
  • 2
  • 7
  • Welcome to Stack Overflow. This is quite a broad question. Have you tried anything yourself or do you have a specific point that is blocking you? – Abizern Sep 14 '12 at 08:05

1 Answers1

0

A UIButton is a UIView. You can animate movement of a UIView; that movement can be to a position offscreen. (See the section under "animation" in the UIView class reference: http://developer.apple.com/library/ios/#documentation/uikit/reference/uiview_class/uiview/uiview.html) You might then want to remove the now-invisible buttons from their superview (in which case you'd need to retain them somehow or they might cease to exist), but you don't have to.

You will need a way to refer to the UIButtons. You can use IBOutlets for this, or you can "tag" the buttons in Interface Builder and use -[UIView viewWithTag:] to find the buttons you want to animate.

For a whole lot more on animation, see my book: http://www.apeth.com/iOSBook/ch17.html

matt
  • 515,959
  • 87
  • 875
  • 1,141