How can I create a popup menu like the one present in WhatsApp?
Sorry
This is a UIAlertController
with an actionSheet
preferred style. You can initialize one like this:
let alert = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
alert.addAction(UIAlertAction(title: "Action 1", style: .default) { _ in
<handler>
})
alert.addAction(UIAlertAction(title: "Action 2", style: .default) { _ in
<handler>
})
present(alert, animated: true)
Read the documentation about it in the iOS Human Interface Guidelines.
Its UIAlertController
with preferredStyle - UIAlertControllerStyle.actionSheet
https://developer.apple.com/documentation/uikit/uialertcontroller