. . . button.addTarget(self, action: #selector(buttonAction), for: .touchUpInside) func buttonAction(_ button: UIButton) { print("Button Pressed.") } // 코드 예시 출처: https://tryyourbest5.tistory.com/323 [Timid Traveller Richard]