skip to Main Content

Can a UILabel exist in the storyboard with height/width constraints but no text?

My app displays data from an API that occasionally lags for a brief second before loading, even with a 3 second delay I set for the LaunchScreen. I currently have those labels set to "0", but it would be better if they could just be blank.

Appreciate any help!

4

Answers


  1. In your viewDidLoad, set label text to empty string

    override func viewDidLoad() {
            super.viewDidLoad()
            // Do any additional setup after loading the view.
            
            yourlabel.text = ""
        }
    

    From the storyboard:

    enter image description here

    And set your label value when you have data.

    Login or Signup to reply.
  2. Yes, you can

    just delete all text in storyboard
    or clear it in viewDidLoad

    myLabel.text = ""
    
    Login or Signup to reply.
  3. Yes, you can set empty text for labels in the storyboard. There is no issue in that.

    Go to storyboard and select label and set nothing(no text) for label.

    Login or Signup to reply.
  4. Yes, You will. You only have to set your label text empty

    yourLabel.text = ""
    

    🙂

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search