Refer to link UIAlertController - add custom views to actionsheet for my UI layout.
I have the same layout of custom action sheet in my app. The code is written in the same way. I noticed that in swift4 the "Cancel" button does not perform any action. When I tap on "Cancel" button in code below
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: {(alert: UIAlertAction!) in
print("Cancel")
})
The code: print(Cancel")
does not execute.