Pixelated TableViewCell element when unclicked becomes smooth only after clicking it
<p>I have a tableview cell that embeds a <a href="https://github.com/luispadron/UICircularProgressRing" rel="nofollow">circular progressbar</a>. </p>

<p>Before selecting the cell, it renders a very pixelated progress bar:</p>

<p><a href="https://i.stack.imgur.com/cWwOD.png" rel="nofollow"><img src="https://i.stack.imgur.com/cWwOD.png" alt="enter image description here"></a></p>

<p>However, after selecting it, it renders smoothly like it's supposed to:</p>

<p><a href="https://i.stack.imgur.com/uumLq.png" rel="nofollow"><img src="https://i.stack.imgur.com/uumLq.png" alt="enter image description here"></a></p>

<p>The setup code looks like this with autolayout applied via <a href="https://github.com/robb/Cartography" rel="nofollow">Cartography</a>:</p>

<pre><code> override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)

        let progressRing = UICircularProgressRingView(frame: CGRect(x: 0, y: 0, width: 50, height: 50))

        progressRing.setProgress(value: 39, animationDuration: 2.0) {
            print("Done animating!")
        }

        let testView = UIView()
        testView.frame = CGRect(x:0,y:0,width:50,height:50)
        testView.backgroundColor = UIColor.red
        testView.addSubview(progressRing)

        self.contentView.addSubview(testView)

        constrain(testView) {tv in
            tv.trailing == tv.superview!.trailing - 25
            tv.top == tv.superview!.top + 10
            tv.bottom == tv.superview!.bottom - 10
            tv.leading == tv.superview!.trailing - 75
            tv.centerY == tv.superview!.centerY

        }
    }
</code></pre>

<p>The same behaviour is exhibited on both the simulator as well as a real device running ios 10. Does anyone know what could be causing this behaviour?</p>