Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Show and Hide Custom Cell

lukeirvinlukeirvin Posts: 388Registered Users @ @
My UITableView is made up entirely of custom cells.

I want to insert and delete one of the cells through some form of animation, but I'm not quite sure the right way to go about this.

Basically want I'd like to accomplish is either:

A) Do an accordion style animation

B) Animate the bottom cell downward to reveal a new cell above it

What would be the best method?

Should this be done via an IBAction or in didSelectRowAtIndexPath?

Replies

  • BrianSlickBrianSlick Treadmill Desk Ninja Posts: 10,676Tutorial Authors, Registered Users @ @ @ @ @ @ @ @
    Well,

    1) What do you want the transition to look like?

    and

    2) When do you want it to happen?
    Professional iOS App Development. Available for hire.
    BriTer Ideas LLC - WWW | Facebook | Twitter | LinkedIn

    BTIKit | BTICoreDataKit | SlickShopper 2 | Leave a PayPal donation
  • lukeirvinlukeirvin Posts: 388Registered Users @ @
    edited September 2013
    So the table view by default will have 5 cells.

    so when cell at row 3 is tapped, I want an animation to happen, maybe an accordion style or just have the cell below it drop, and then the new cell will be added and if the cell is tapped again, the new cell will disappear and the bottom cell will animate back up.

    This will only happen at this one desired location.
  • lukeirvinlukeirvin Posts: 388Registered Users @ @
    Also, this "new cell" is a custom cell as well. Everything's already hooked up in Interface Builder.
  • BrianSlickBrianSlick Treadmill Desk Ninja Posts: 10,676Tutorial Authors, Registered Users @ @ @ @ @ @ @ @
    Ok, you totally missed my questions.

    What do YOU want it to look like? There are standard transitions and there are non-standard transitions. Naturally, standard ones are easier to deal with. There is nothing standard about an accordion style, though perhaps there is a 3rd-party library that will help. If you have seen the transition elsewhere, it is therefore possible, only a question of how much work is involved.

    Do you want the user to tap in a specific location (use a button) or do you want the user to tap anywhere in the row (didSelectRow)?
    Professional iOS App Development. Available for hire.
    BriTer Ideas LLC - WWW | Facebook | Twitter | LinkedIn

    BTIKit | BTICoreDataKit | SlickShopper 2 | Leave a PayPal donation
  • lukeirvinlukeirvin Posts: 388Registered Users @ @
    Ok, my apologies.

    Based on my research, withRowAnimation:UITableViewRowAnimationTop seems to be the common RowAnimation used.

    The table is a set size positioned in the view's center so I'd like to keep it there.

    The animation would need to look as though from the cell tapped and up, it is raising up, and the bottom cell is going down, and the hidden cell is displayed in between.

    Either layering a button over that cell or using didSelectRow would be fine, which ever seems to be most convenient.

    I haven't seen many use a button.
  • BrianSlickBrianSlick Treadmill Desk Ninja Posts: 10,676Tutorial Authors, Registered Users @ @ @ @ @ @ @ @
    Ok, so make up a sample app that you can use to observe the different animation options and decide which one you like the best. If none of those meet your needs, you will have to look for a 3rd-party library or roll your own code.
    Professional iOS App Development. Available for hire.
    BriTer Ideas LLC - WWW | Facebook | Twitter | LinkedIn

    BTIKit | BTICoreDataKit | SlickShopper 2 | Leave a PayPal donation
Sign In or Register to comment.