Fully updated for Xcode 11.4
SwiftUI gives us the
mask() modifier for masking one with another, which means you can mask an image using text or an image using an image, or more.
For example, this creates a 300x300 image of stripes, then masks it using the text “SWIFT!” so that the letters act as a cut out for the image:
Image("stripes") .resizable() .frame(width: 300, height: 300) .mask(Text("SWIFT!") .font(Font.system(size: 72).weight(.black)))
SPONSORED Catch bugs as soon as they happen and know exactly why a crash occurred by integrating Instabug's SDK in one minute. You will automatically receive device data, network logs, and reproduction steps with every bug and crash report.
Link copied to your pasteboard.