0

I have a label with some text in, that is currently just set to the default colour and fill. I also have an abstract image.

How can you use the image to fill the text so that the text looks patterned?

shallowThought
  • 19,212
  • 9
  • 65
  • 112
ZiEiTiA
  • 275
  • 2
  • 16
  • see http://stackoverflow.com/questions/1266179/how-do-i-add-a-gradient-to-the-text-of-a-uilabel-but-not-the-background – Jon Rose Jan 15 '17 at 11:21
  • These deal with gradients as opposed to images, and are written in Objective C which I have no idea how to use. – ZiEiTiA Jan 15 '17 at 11:28
  • What actually you what, please show Image for more clearance of your question. – dahiya_boy Jan 15 '17 at 11:52

1 Answers1

3

UIColor can be created from a pattern image, so anywhere you can use a UIColor you can use an image.

    label.textColor = UIColor(patternImage: image));
Jon Rose
  • 8,373
  • 1
  • 30
  • 36