NotPaid

main

Client did not pay? Add opacity to your environment and decrease it every day until their app completely fades away. Inspired by @kleampa.
observableobject/not-paid-ios

NotPaid - SwiftUI

Client did not pay?

Add opacity to any SwiftUI View and decrease it every day until their app completely fades away. Set a due date and customize the number of days you offer them until the app is fully vanished.

Requirements

Requires iOS 13.0+

Installation

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler.

Once you have your Swift package set up, adding NotPaid as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/vfrascello/not-paid-ios.git")
]

Manually

If you prefer not to use any of the Swift pacakage manager, you can simply copy NotPaid.swift into your project.

Usage

  1. Import the package.
import NotPaid
  1. Create a NotPaidSettings object, passing in a dueDate and a deadline (default is 60 days) in your App file or root View.
let settings = NotPaidSettings(dueDate: Date() + 30 * 86400, deadline: 60)
  1. Use the .environmentObject(_ object:) modifier to apply your settings to the environment.
var body: some Scene {
    WindowGroup {
        ContentView().environmentObject(settings)
    }
}
  1. Apply NotPaid using .notPaid() on any View. NotPaid will modify the opacity to the appropriate level.
VStack{
    Text("Hello, world!")
    Image(systemName: "person.fill").frame(width: 100, height: 100, alignment: .center)
}
.notPaid()

Acknowledgements

Based on the original Javascript implementation by @kleampa.

A Wordpress plugin is also available here.

There's also an Android version available here.

There's also an Windows Forms version available here.

Flutter version available here.

Author

Inspired from twitter (@riklomas) Made by Vincent Frascello (@vfrascello), USA

Description

  • Swift Tools 5.6.0
View More Packages from this Author

Dependencies

  • None
Last updated: Mon Apr 15 2024 06:30:25 GMT-0900 (Hawaii-Aleutian Daylight Time)