HyperwalletUtilViews
public struct HyperwalletUtilViews
Displays the common UI Views - Alerts and Spinners
-
show an alert dialog
Declaration
Swift
public static func showAlert(_ viewController: UIViewController, title: String?, message: String?)
Parameters
viewController
current view
title
title shown in the dialog
message
description shown in the dialog
-
Display the alert view with custom list of options
Declaration
Swift
public static func showAlert( _ viewController: UIViewController, title: String? = nil, message: String?, style: UIAlertController.Style = .alert, actions: UIAlertAction...)
-
show an alert dialog with retry button
Declaration
Swift
public static func showAlertWithRetry( _ viewController: UIViewController, title: String?, message: String?, _ retry: @escaping (UIAlertAction) -> Void)
Parameters
viewController
current view
title
title shown in the dialog
message
description shown in the dialog
retry
an action needs to be retried
-
Displays the Activity Indicator embedded on view
Example: the
self
is ViewController let spinnerView = HyperwalletUtilViews.showSpinner(view: self.view )DispatchQueue.main.asyncAfter(deadline: .now() + 2) { // represent a callback HyperwalletUtilViews.removeSpinner(spinnerView) }
Declaration
Swift
public static func showSpinner(view: UIView) -> SpinnerView
Return Value
SpinnerView
-
Remove the
SpinnerView
with animationDeclaration
Swift
public static func removeSpinner(_ spinnerView: SpinnerView)
-
Displays the Processing view in a modal view for indicating the UI is processing the data
Example: To show ProcessingView: let processingView = HyperwalletUtilViews.showProcessing()
To hide with Complete state: processingView.hide(with: .complete)
To dismiss ProcessView with the same state: processingView.hide()
Declaration
Swift
public static func showProcessing() -> ProcessingView
Return Value
ProcessingView