CommonHelper.swift 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // CommonHelper.swift
  3. // Sirani
  4. //
  5. // Created by Hendi on 04/01/24.
  6. // Copyright © 2024 PT. Mitra Sinerji Teknoindo. All rights reserved.
  7. //
  8. import Foundation
  9. import UIKit
  10. class CommonHelper {
  11. class func showNoConnection(in viewController: UIViewController) {
  12. let alertNoConnection = UIAlertController(
  13. title: Constants.instance.ALERT_NO_CONNECTION_TITLE,
  14. message: Constants.instance.ALERT_NO_CONNECTION_MSG,
  15. preferredStyle: .alert
  16. )
  17. alertNoConnection.addAction(
  18. UIAlertAction(title: Constants.instance.ALERT_NO_CONNECTION_YESS, style: .default, handler: nil)
  19. )
  20. viewController.present(alertNoConnection, animated: true, completion: nil)
  21. }
  22. class func showNotAllowConnection(in viewController: UIViewController) {
  23. let alertNoConnection = UIAlertController(
  24. title: Constants.instance.ALERT_NO_CONNECTION_TITLE,
  25. message: Constants.instance.ALERT_NOT_ALLOW_MSG,
  26. preferredStyle: .alert
  27. )
  28. alertNoConnection.addAction(
  29. UIAlertAction(title: Constants.instance.ALERT_NO_CONNECTION_YESS, style: .default, handler: nil)
  30. )
  31. viewController.present(alertNoConnection, animated: true, completion: nil)
  32. }
  33. // CommonHelper.showNoConnection(in: self)
  34. // CommonHelper.showNotAllowConnection(in: self)
  35. }