uilabel - Send Labels forward and back in Swift... do I have to? -


i uilabel continually update behind interface elements on same screen. can see label starts below other elements using debug view hierarchy tool in swift's xcode tool. update text in label, jumps top , writes on other labels , interface elements.

first image 3d debugger image

first question... can't find tool setting front layers in interface builder... if can point out me that'd great, google has not been friend.

since it's going end on top when update label, figure can send label whenever refresh it... in viewcontroller.swift file, in function update label's text, i've tried: (my label's outlet hook called "consoleme"

super.sendsubview(toback:consoleme) 

nope... that's backwards maybe? tried:

consoleme.sendsubview(toback: super) 

...as "self" instead of super. doesn't super @ all. complains self viewcontroller , not uiview.

finally, i'm wondering if have @ all-- surely there's way specify uilabel should remain below other stuff?

am correct updating uilabel automatically brings front (or else going on?) tried make other labels , items "opaque" of course had no effect end below console label.

thanks! -d

sendsubview(toback:) method of uiview , uiviewcontroller objects contain view built in.

from uiviewcontroller documentation:

view management

each view controller manages view hierarchy, root view of stored in view property of class.

therefore call sendsubview(toback:) on view property instead:

view.sendsubview(toback: consoleme) 

Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -