macOS, iOS

[iOS] UIAlertAction handler

SweetDev 2019. 8. 28. 14:39

UIAlertAction(title: "취소", style: .cancel, handler: nil)

 

handler를 쓰고 싶다면, 

UIAlertAction(title: "취소", style: .cancel, handler:{ (_) in } )

이렇게 쓰면 아무것도 안쓴 것과 같다!

 

어떤 내용을 쓰고 싶다면,

UIAlertAction(title: "취소", style: .cancel, handler:{ (_) in //여기에 내용 작성 } )