Garrison Locke
Jul 21, 2017 · 1 min read

I ported this to Swift 3 if anyone is interested.

import UIKitclass CustomDisclosureIndicator: UIView {  @IBInspectable var color = UIColor.black {    didSet {
setNeedsDisplay()
}
}
override func draw(_ rect: CGRect) { let context = UIGraphicsGetCurrentContext()
let x = self.bounds.maxX — 3
let y = self.bounds.midY
let R = CGFloat(4.5)
context?.move(to: CGPoint(x: x — R, y: y — R))
context?.addLine(to: CGPoint(x: x, y: y))
context?.addLine(to: CGPoint(x: x — R, y: y + R))
context?.setLineCap(CGLineCap.square)
context?.setLineJoin(CGLineJoin.miter)
context?.setLineWidth(2)
color.setStroke()
context?.strokePath()
}
}

)

    Garrison Locke

    Written by

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade