Created
May 9, 2016 06:42
-
-
Save dfelber/6195549e652a32b1f92c390919c98816 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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