I have a UILabel which I want to be displayed at the center of screen regardless of which iPhone it is played on!
But I can't get it right! It's always somewhere else but not in the middle.
what am i doing wrong?
Here is the picture and code of what is happening!
class end: SKScene {
var label = UILabel()
override func didMoveToView(view: SKView) {
scene?.backgroundColor = UIColor(red: CGFloat(59.0/255.0), green: CGFloat(89.0/255.0), blue: CGFloat(152.0/255.0), alpha: CGFloat(1.0))
let w = UIScreen.mainScreen().bounds.width
let h = UIScreen.mainScreen().bounds.height
label = UILabel(frame: CGRect(x: w / 2, y: h / 2, width: 120, height: 30))
label.text = "REPLAY"
label.center = CGPoint(x: w / 2, y: 2)
label.textColor = UIColor.whiteColor()
self.view?.addSubview(label)