Orderella / PopupDialog

A simple, customizable popup dialog for iOS written in Swift. Replaces UIAlertController alert style.
http://www.mwfire.de
Other
3.96k stars 522 forks source link

using the popupdialog with an activityindicator #313

Closed jrumol closed 5 years ago

jrumol commented 5 years ago

I have been thinking about using popupdialog to load an activity indicator when loading a viewcontroller, until the data is loaded into a tableview. However, I don't know how to dismiss the dialog when the data load has finished.

mwfire commented 5 years ago

Hey there!

This should be possible by keeping a reference to the dialog, e.g. as a property of the view controller:

let acitivityDialog: PopupDialog = {
    let dialog = PopupDialog(...)
   // ...
    return dialog
}()

When loading starts, you present the dialog like present(activityDialog, animated: true), while you can dismiss it via activityDialog.dismiss().

Does that work for you?

Kirow commented 5 years ago

@mwfire this will not work correctly on second present. Related to #43

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.