Swiftpack.co -  maukur/DialogService as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
maukur/DialogService
DialogService from ViewModels for SwiftUI
.package(url: "https://github.com/maukur/DialogService.git", from: "3.0.0")

DialogService

A Dialog Service for easy way using from buisness logic layer for UIKit and SwiftUI

Setup with Swift PM

  1. Add ‘DialogService’ to your Project’s ‘Swift Packages’ section.
  2. Input desired version.
  3. Adding package dependencies to your App.

Usage

Initialization

@main
struct thisorthatApp: App {
  init() {
    DialogService.initialize(getTopViewController: getTopViewController)
  }
  
  func getTopViewController() -> UIViewController? {
    return UIApplication.shared.windows.first?.rootViewController;
  }
} 

Using

class PurchaseViewModel: DialogProtocol {
  func shopError() {
    showAlert(title: "Error", message: "Do you want continiue", action: "Yes", cancelAnction: "No") { result in
      if result {
         foo()
      }
      else {
         bar()
      }
    }
  }
}

Sample

alt text alt text

GitHub

link
Stars: 3
Last commit: 30 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Dependencies

Release Notes

3.0.0
30 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API