1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Help with making a button

Discussion in 'iPhone/iPad Programming' started by MrPenguin9, Nov 20, 2008.

  1. macrumors member

    How do you tell it during the button is held down do this, and when you let go of the button do this?

    Thanks so much
  2. macrumors 6502a

    In Interface Builder add a couple of IBActions for (respectively) Touch Down and Touch Up Inside.
  3. macrumors 68000

    And if you want to do it programatically, then you'd go

    [myButton addTarget:self action:@selector(touchDownAction:) forControlEvents:UIControlEventTouchDown];
    [myButton addTarget:self action:@selector(touchUpAction:) forControlEvents:UIControlEventTouchUpInside];
  4. macrumors member

    Thanks for your help!:)

Share This Page