zachwick / watermark

a SwiftUI ViewModifier for adding a text watermark to a component

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Watermark

A SwiftUI ViewModifier to add a text watermark to a component.

Usage

In your Package.swift file, add the following

.package(url: "https://github.com/zachwick/watermark.git", from: "1.0.0")
import Watermark

struct ContentView: View {
  var body: some View {
    VStack {
      Color.blue
        .frame(width: 300, height: 50)
        .watermarked(with: "a default watermark")
      Color.red
        .frame(width: 300, height: 50)
        .watermarked(with: "non-default options", alignment: .bottomLeading, opacity: 0.75, foreground: .blue, background: .white)
    }
  }
}

example

License

Watermark is released under the MIT license

About

a SwiftUI ViewModifier for adding a text watermark to a component

License:MIT License


Languages

Language:Swift 100.0%