coderLIfe coderLIfe - 1 month ago 9
Swift Question

How to reuse header section all scene?

I want to reuse

header
section all
view controller scene
.header section mean green view and label ("AMAR LIFE")

Here is my may 1st view controller scene



Here is my 1st view controller document outline



UPDATE

if i do not use
navigation controller
and
tab bar controller
. how can i reuse
header
section all
view controller scene
? .

enter image description here

Answer

Subclass UITabBarController. Make the green view a subview of the tab bar controller's main view. Whenever the selected view controller changes (or anything else happens), keep bringing the green view to the front. (Even better, make the green view a layer, not a view, and give it a higher z-position so that it automatically floats in front of all subviews.)

Comments