In my Swift Xcode project, I am trying to change the text in a UILabel to an integer which is the score.
scoreLabel.text = String(score);
scoreLabel is a UILabel and score is an integer that is casted to a String, and used as the text for scoreLabel. When I enter this line in my project, my application glitches very severely and I don't know why. What is the best way to display a changing score in Xcode? I want to display an integer on the application screen and have it chnage programmatically. Thanks in advance.
Usually this kind of stuff happens when you try to modify the UI from a background thread.
Try this:
NSOperationQueue.mainQueue().addOperationWithBlock { self.scoreLabel.text = "\(score)" }
If that works, then that is your problem. If not... then I have no idea unfortunately.