Search code examples
iosswifteureka-forms

Using AlertRow with Eureka How to close Alert window when touching anywhere outside


I'm using AlertRow in Eureka library.

Is it possiple to close Alert window when touching anywhere outside ?

Eureka AlertRow

<<< AlertRow<String>("categoryTag") {
    $0.title = "AlertRow"
    $0.optionTitle = "Pick a number"
    $0.options = ["One","Two","Three"]
    $0.value = "Two"
}

Solution

  • If you go deeper you see that AlertRow is UIAlertController with .alert preferred style under the hood. There is no default implementation of closing alert by tapping outside the alertController, but you can subclass your own XXXAlertRow and implement this logic (SO example).