Drawing multiple rectangle using DrawRect efficiently – Ios swift
I'm trying to draw rectangles pattern using DrawRect like this: Currently, I'm doing this like so: class PatternView: UIView { override func draw(_ rect: CGRect) { let context = UIGraphicsGetCurrentContext() let numberOfBoxesPerRow = 7 let boxSide: CGFloat = rect.width /…