ios - How can I add an interactive view controller inside of a UITableViewCell? -


in project have uitableview holds horizontal scrolling uicollectionviews. each cell in table view new collection view. need have interactive view on left side of each cell. view collapsed along left side, if tap view, animate open little bit. if collection view scrolled way left, i.e. beginning, open. once user starts scrolling collection view automatically close.

here visual example:

table view cell..

the view collapsed in image. ____________________________ |v |                       | |i |    collectionview     | |e |    scrolls </>        | |w_|_______________________|       view open in image. ways opens described above. ____________________________ |v      |                  | |i      |  collectionview  | |e      |  scrolls </>     | |w______|__________________|    

how able have interactive controller on left side of cell, has collection view within?

also if there 3rd party controls this, great also!

that uiview - not uiviewcontroller - placed left of uicollectionview.

inside uicollectionview delegate method cellforitematindexpath expand , retract cellleftsideview whenever first collection view cell visible:

if ([[cell_collectionview indexpathsforvisibleitems] containsobject:[nsindexpath indexpathforitem:0 insection:0]]) {      // first item showing in collection view     // make sure left side view expanded      [uiview animatewithduration:0.5 animations:^{         cgrect aframe = cell_leftsideview.frame;         aframe.size.width = kcellleftsideview_width_max;    // <= #define maximum width value         cell_leftsideview.frame = aframe;     }]; } else {     // first item not showing in collection view     // make sure left side view shrunk      [uiview animatewithduration:0.5 animations:^{         cgrect aframe = cell_leftsideview.frame;         aframe.size.width = kcellleftsideview_width_min;    // <= #define minimum width value         cell_leftsideview.frame = aframe;     }]; } 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -