Swift3 Alert 디스플레이의 두 가지 방법
                                            
                                                
                                                
                                                
                                                
                                                
                                                 6600 단어  swift3
                    
Alert 메시지 표시(화면 중앙에 표시됨)
 
swift3let alertController = UIAlertController(title: "選択してコメントを削除しますか?",message: "一度削除すると元に戻せません。", preferredStyle: UIAlertControllerStyle.alert)
//UIAlertActionStye.destructive指定でフォントを赤色に変更できす
let okAction = UIAlertAction(title: "削除する", style: UIAlertActionStyle.destructive){ (action: UIAlertAction) in
     print("コメント削除")
}
let cancelButton = UIAlertAction(title: "キャンセル", style: UIAlertActionStyle.cancel, handler: nil)
alertController.addAction(okAction)
alertController.addAction(cancelButton)
self.present(alertController,animated: true,completion: nil)
 ActionSheet 표시(화면 아래에 표시됨)
 
swift3//タイトルとメッセージを表示したくない場合「nil」指定
let alert: UIAlertController = UIAlertController(title: nil, message: nil, preferredStyle:  UIAlertControllerStyle.actionSheet)
let informantAction: UIAlertAction = UIAlertAction(title: "コメントを通報する", style: UIAlertActionStyle.destructive, handler:{
                    (action: UIAlertAction!) -> Void in
     print("コメントを通報する")
})
let cancelAction: UIAlertAction = UIAlertAction(title: "キャンセル", style: UIAlertActionStyle.cancel, handler:{
                    (action: UIAlertAction!) -> Void in
     print("キャンセル")
})
alert.addAction(cancelAction)
alert.addAction(informantAction)
self.present(alert, animated: true, completion: nil)
                
                    
        
    
    
    
    
    
                
                
                
                
                    
                        
                            
                            
                            Reference
                            
                            이 문제에 관하여(Swift3 Alert 디스플레이의 두 가지 방법), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
                                
                                https://qiita.com/HavenSpring/items/acba0850be494caa31d4
                            
                            
                            
                                텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                            
                            
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                            
                            
                        
                    
                
                
                
            
let alertController = UIAlertController(title: "選択してコメントを削除しますか?",message: "一度削除すると元に戻せません。", preferredStyle: UIAlertControllerStyle.alert)
//UIAlertActionStye.destructive指定でフォントを赤色に変更できす
let okAction = UIAlertAction(title: "削除する", style: UIAlertActionStyle.destructive){ (action: UIAlertAction) in
     print("コメント削除")
}
let cancelButton = UIAlertAction(title: "キャンセル", style: UIAlertActionStyle.cancel, handler: nil)
alertController.addAction(okAction)
alertController.addAction(cancelButton)
self.present(alertController,animated: true,completion: nil)

swift3
//タイトルとメッセージを表示したくない場合「nil」指定
let alert: UIAlertController = UIAlertController(title: nil, message: nil, preferredStyle:  UIAlertControllerStyle.actionSheet)
let informantAction: UIAlertAction = UIAlertAction(title: "コメントを通報する", style: UIAlertActionStyle.destructive, handler:{
                    (action: UIAlertAction!) -> Void in
     print("コメントを通報する")
})
let cancelAction: UIAlertAction = UIAlertAction(title: "キャンセル", style: UIAlertActionStyle.cancel, handler:{
                    (action: UIAlertAction!) -> Void in
     print("キャンセル")
})
alert.addAction(cancelAction)
alert.addAction(informantAction)
self.present(alert, animated: true, completion: nil)
                Reference
이 문제에 관하여(Swift3 Alert 디스플레이의 두 가지 방법), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/HavenSpring/items/acba0850be494caa31d4텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)