Swift - How To Make A Table Containing Labels
<p>This is what I want to achieve.</p>

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

<p>I tried coding it myself but the first outer view border does not show up.</p>

<p>Here's my code:</p>

<pre><code>import UIKit

class InfoTableView: UIView {

    override func drawRect(rect: CGRect) {

        self.backgroundColor = UIColor.whiteColor()

        let outerBorder = UIColorCode.init(hexString: "#666666")
    let startingTopPoint   = CGPoint(x: rect.minX, y: rect.minY)
    let endingTopPoint  = CGPoint(x: rect.maxX, y: rect.minY)

    let startingPoint   = CGPoint(x: rect.minX, y: rect.maxY)
    let endingPoint     = CGPoint(x: rect.maxX, y: rect.maxY)

        // top
        let tpPath = UIBezierPath()
        tpPath.moveToPoint(startingPoint)
        tpPath.addLineToPoint(endingTopPoint)
        tpPath.lineWidth = 2.0

        outerBorder.setStroke()
        tpPath.stroke()

        // bottom
        let btPath = UIBezierPath()

        btPath.moveToPoint(startingPoint)
        btPath.addLineToPoint(endingPoint)
        btPath.lineWidth = 2.0

        outerBorder.setStroke()
        btPath.stroke()

    }
}
</code></pre>

<p>There are outer borders top and bottom. But only the bottom one shows up. I don't know where did I go wrong.</p>