Skip to content

Instantly share code, notes, and snippets.

@dfelber
Created May 9, 2016 06:42
Show Gist options
  • Save dfelber/6195549e652a32b1f92c390919c98816 to your computer and use it in GitHub Desktop.
Save dfelber/6195549e652a32b1f92c390919c98816 to your computer and use it in GitHub Desktop.
import Foundation
import UIKit
@IBDesignable
class PatternImageView: UIImageView
{
@IBInspectable var repeats: Bool = true
{
didSet {
guard let img = self.image else {
return
}
self.backgroundColor = UIColor(patternImage: img)
self.image = nil
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment