Add opacity to any SwiftUI View and decrease it every day until their app completely fades away

Overview

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: yourDueDate, deadline: yourDeadline)

where yourDueDate is a Date object and yourDeadline is an Int representing the number of days after due date until zero opacity.

  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")
}
.notPaid()

P.S. If you want the ability to remotely enable/disable NotPaid, you can adjust settings.isActive to your remote configuration of choice.

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

You might also like...
iOS calculator app made without storyboard.
iOS calculator app made without storyboard.

Calculator app Standart iOS calculator app written without storyboard - elements placed only by using code. FUN FACT - you can download it and install

Bmi calculator app (iOS)
Bmi calculator app (iOS)

BMI Calculator Our Goal The goal of this tutorial is to learn more about Optionals, solidify your understanding of the MVC design pattern and to intro

BodyMassIndexCalculator - A multiscreen BMI Calculator app
BodyMassIndexCalculator - A multiscreen BMI Calculator app

Body Mass Index Calculator A multiscreen BMI Calculator app Uses UISliders for w

Currency Converter - Free and Quick Converter calculates money quick and easy way to see live foreign exchange rates.
Currency Converter - Free and Quick Converter calculates money quick and easy way to see live foreign exchange rates.

Currency Converter - Free and Quick Converter calculates money quick and easy way to see live foreign exchange rates. This app is available in the App

Splito - Nice and easy-to-use billing and tip calculator with swift
Splito - Nice and easy-to-use billing and tip calculator with swift

Splito! Nice and easy-to-use billing and tip calculator

Mobile, desktop and website Apps with the same code
Mobile, desktop and website Apps with the same code

Mobile, desktop and website Apps with the same code This project shows how the source code can be architectured to run on multiple devices. As of now,

A tip calculator for iOS (in Swift) and Android

Round & Split I needed a tip calculator, so I wrote one. I always round my tips, and when I dine out with a friend, I email them reminders that I owe

Tip-Calculation- - A program for calculate the tip. You can easily calculate it and you can split money easily
Tip-Calculation- - A program for calculate the tip. You can easily calculate it and you can split money easily

Tip-Calculation- It is a program for calculate the tip. You can easily calculate

A hobby project using Swift protocol and Swift 5.7's new generics to build an iOS Calculator-like calculator.
A hobby project using Swift protocol and Swift 5.7's new generics to build an iOS Calculator-like calculator.

Calculator A hobby project using Swift protocol and Swift 5.7's new generics to build an iOS Calculator-like calculator. Highlights: You can use Calcu

Owner
Vincent Frascello
iOS Developer, Chemical Engineer and Photographer.
Vincent Frascello
A clone of the built-in iOS Calculator APP for iPadOS, using SwiftUI

A clone of the built-in iOS Calculator APP for iPadOS, using SwiftUI Yes, it looks exactly the same as the iOS built-in Calculator The UI is implement

Bobby Wang 31 Jan 1, 2023
Bill splitting and tip calculating app, build with UIKit and MVC pattern.

Split Check Bill splitting and tip calculating app, build with UIKit and MVC pattern. Features Enter bill total with number pad. Select tip % and betw

Anibal Ventura 0 Jan 7, 2022
Recreation of calculator-checklist project in SwiftUI

Calculator Checklist A project created out of curiosity to test the waters of SwiftUI, Apple's new UI Framework. The caculator-checklist concept was o

T. Abbas Khan 278 Nov 17, 2022
A Windows calculator ported to macOS with SwiftUI interface.

Windows Calculator on Apple A Windows calculator ported to macOS with SwiftUI interface. Standard Programmer Build Clone the project: git clone --recu

Li-Huai (Allan) Lin 4 Dec 31, 2022
IBCalculator is an example app to demonstrate how to use @IBDesignable and @IBInspectable

IBCalculator IBCalculator is an example app to demonstrate how to use @IBDesignable and @IBInspectable. The origin code is from IBInspectable / IBDesi

Jake Lin 62 Nov 12, 2022
BMI-Calculator - An app which calculates the BMI and gives suggestion

BMI-Calculator An app which calculates the BMI and gives suggestion with MVC pat

null 0 Jan 19, 2022
Implementation of LondonAppBrewery's BMI Calculator App

BMI Calculator ?? Our Goal The objective of this tutorial is to look at how we can customise Flutter Widgets to achieve our own beautiful user interfa

Marianne Leal 0 Dec 8, 2021
Basic calculator app for iOS devices using Swift3. Created for learning purpose.

iOS Calculator App Basic calculator app for iOS devices using Swift 4 and Xcode 9. Created for learning purpose. How to use Just download source code

Jogendra 15 Dec 28, 2022
A basic discount calculator app Using Swift

DiscountCalcuator This is a basic discount calculator app I created. Have you ever been out shopping and there is a really awesome sale going on? Well

Alex Diaz 1 Dec 11, 2021
Bill splitting app with tip feature

Tipsy Tipsy is a bill splitting app with tip feature. You can split the total bi

Emrullah Cirit 4 Nov 29, 2022