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
viewControllercurrent view
titletitle shown in the dialog
messagedescription 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
viewControllercurrent view
titletitle shown in the dialog
messagedescription shown in the dialog
retryan action needs to be retried
-
Displays the Activity Indicator embedded on view
Example: the
selfis 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) -> SpinnerViewReturn Value
SpinnerView
-
Remove the
SpinnerViewwith 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() -> ProcessingViewReturn Value
ProcessingView
View on GitHub