Skip to content

Instantly share code, notes, and snippets.

Last active October 31, 2019 11:06
What would you like to do?
Renders a tiled image in a view. Also renders in the storyboard.
class TiledImageView:UIView {
@IBInspectable var image:UIImage?
override func draw(_ rect: CGRect) {
guard let image = image else {return}
UIColor(patternImage: image).setFill()
let path = UIBezierPath(rect: rect)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment