Placing UILabel in the center of screen
<p>I have a <strong>UILabel</strong> which I want to be displayed at the center of screen regardless of which iPhone it is played on!</p>

<p>But I can't get it right! It's always somewhere else but not in the middle. </p>

<p>what am i doing wrong?</p>

<p>Here is the picture and code of what is happening!</p>

<p><a href="https://i.stack.imgur.com/htS7I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/htS7I.png" alt="so not in the middle!"></a></p>

<pre><code>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)
</code></pre>