ActionSheet를 구현하는 방법 [Xcode/Storyboard]
                                            
                                                
                                                
                                                
                                                
                                                
                                                 4303 단어  XcodeactionSheet
                    
Xcode/Storyboard에서 어떻게 구현하는지 쉽게 구현하고 기사로 했습니다.
환경
・Mac Book Pro(macOS:BigSur)
・Xcode(ver:12.5)
 구현 예
 
 코드 예
ViewController.swiftclass ViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    @IBAction func showAlert(_ sender: Any) {
        let alertController = UIAlertController(title: "タイトル", message: "メッセージ", preferredStyle: .actionSheet)
        let action1 = UIAlertAction(title: "タイトル1", style: .default) { alert in
            print("Action1")
        }
        let action2 = UIAlertAction(title: "タイトル2", style: .default) { (alert) in
            print("Action2")
        }
        let action3 = UIAlertAction(title: "キャンセル", style: .cancel, handler: nil)
        alertController.addAction(action1)
        alertController.addAction(action2)
        alertController.addAction(action3)
        self.present(alertController, animated: true, completion: nil)
    }
}
                
                    
        
    
    
    
    
    
                
                
                
                
                    
                        
                            
                            
                            Reference
                            
                            이 문제에 관하여(ActionSheet를 구현하는 방법 [Xcode/Storyboard]), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
                                
                                https://qiita.com/swiftEnginnerY/items/10e3203b225b1fc3c58f
                            
                            
                            
                                텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                            
                            
                                
                                
                                 우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                            
                            
                        
                    
                
                
                
            

코드 예
ViewController.swiftclass ViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    @IBAction func showAlert(_ sender: Any) {
        let alertController = UIAlertController(title: "タイトル", message: "メッセージ", preferredStyle: .actionSheet)
        let action1 = UIAlertAction(title: "タイトル1", style: .default) { alert in
            print("Action1")
        }
        let action2 = UIAlertAction(title: "タイトル2", style: .default) { (alert) in
            print("Action2")
        }
        let action3 = UIAlertAction(title: "キャンセル", style: .cancel, handler: nil)
        alertController.addAction(action1)
        alertController.addAction(action2)
        alertController.addAction(action3)
        self.present(alertController, animated: true, completion: nil)
    }
}
                
                    
        
    
    
    
    
    
                
                
                
                
                    
                        
                            
                            
                            Reference
                            
                            이 문제에 관하여(ActionSheet를 구현하는 방법 [Xcode/Storyboard]), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
                                
                                https://qiita.com/swiftEnginnerY/items/10e3203b225b1fc3c58f
                            
                            
                            
                                텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                            
                            
                                
                                
                                 우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                            
                            
                        
                    
                
                
                
            
class ViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    @IBAction func showAlert(_ sender: Any) {
        let alertController = UIAlertController(title: "タイトル", message: "メッセージ", preferredStyle: .actionSheet)
        let action1 = UIAlertAction(title: "タイトル1", style: .default) { alert in
            print("Action1")
        }
        let action2 = UIAlertAction(title: "タイトル2", style: .default) { (alert) in
            print("Action2")
        }
        let action3 = UIAlertAction(title: "キャンセル", style: .cancel, handler: nil)
        alertController.addAction(action1)
        alertController.addAction(action2)
        alertController.addAction(action3)
        self.present(alertController, animated: true, completion: nil)
    }
}
Reference
이 문제에 관하여(ActionSheet를 구현하는 방법 [Xcode/Storyboard]), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/swiftEnginnerY/items/10e3203b225b1fc3c58f텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)