How to create alert, sliding from bottom with buttons on iOS?

Viewed 6651

How to create an alert like Instagram unfollow alert(two buttons, image and message) on iOS? Is there any ready component or should I develop it from scratch? Here is a screenshot:

enter image description here

2 Answers

Swift 4 version

let deleteAlert = UIAlertController(title: "Unfollow", message: "", preferredStyle: UIAlertController.Style.actionSheet)

    let unfollowAction = UIAlertAction(title: "Unfollow", style: .destructive) { (action: UIAlertAction) in
        // Code to unfollow
    }

    let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)

    deleteAlert.addAction(unfollowAction)
    deleteAlert.addAction(cancelAction)
    self.present(deleteAlert, animated: true, completion: nil)
Related