Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
import UIKit
public extension UIAlertController {
private typealias AlertHandler = @convention(block) (UIAlertAction) -> Void
func tapButton(title: String) {
let action = actions.first(where: { $0.title == title })
if let action = action, let block = action.value(forKey: "handler") {
let handler = unsafeBitCast(block as AnyObject, to: AlertHandler.self)
handler(action)
dismiss(animated: false)
let animationLength = Animation.Length.dismissAlert.rawValue
RunLoop.current.run(until: Date().addingTimeInterval(animationLength))
}
}
}