ios - Static UITableView inside ContainerView not Scrolling -
a uiviewcontroller
has titleview @ top, uicontainerview
which manage 2 tableviewcontroller
, , last item uisegmentedcontrol
used change between logintableviewcontroller
, registertableviewcontroller
have 15 cells, it's needed scroll on them.
logintableviewcontroller
, registertableviewcontroller
statics table views can't scroll, means if scroll it, returns top.
also have viewcontroller
has containerview
uitableviewcontroller
inside isn't static , can scroll.
here code of segmentecontrolaction
@ibaction func selecttab(_ sender: uisegmentedcontrol) { let nextviewcontroller: uitableviewcontroller! switch sender.selectedsegmentindex { case 0: let loginviewc = logintableviewcontroller.instantiatefromstoryboard() loginviewc.ispresentingfrommenu = ispresentingfrommenu nextviewcontroller = loginviewc break default: let regiterviewc = registertableviewcontroller.instantiatefromstoryboard() regiterviewc.ispresentingfrommenu = ispresentingfrommenu nextviewcontroller = regiterviewc break } if let currentviewcontroller = currentviewcontroller{ currentviewcontroller.willmove(toparentviewcontroller: nil) currentviewcontroller.view.removefromsuperview() currentviewcontroller.removefromparentviewcontroller() } currentviewcontroller = nextviewcontroller addchildviewcontroller(currentviewcontroller!) containerview.addsubview(currentviewcontroller!.view) currentviewcontroller!.didmove(toparentviewcontroller: self) }
do know i'm missing ?
edited
if set tableviewcontroller
which has 15 cells embed view of containerview, scroll works, when change childviews in container scroll don't works
Comments
Post a Comment