2014-06-06 4 views
-1

빠른 언어를 사용하여 xcode6을 사용하여 프로그래밍 방식으로 액션 시트 컨트롤러를 만드는 사람을 도와주십시오.액션 시트 프로그래밍 방식

+2

를? 스위프트는 새로운 프로그램입니다. 최근 xcode6 및 ios8을 사용하여 Apple에서 출시 한 언어. –

+1

중요한 비트는 "최소 예제 포함"입니다. 지금까지 해보지 못한 것은 무엇입니까? – memmons

답변

4

질문이 너무 일반적인 것 같습니다.

은 당신이 시작하는 데 도움이 될 How would I create a UIAlertView in Swift?

이 참조 할 수있을 수 있습니다.

이 좋아할 것 UIActionSheet 사용하여 신속 제시의 전형적인 코드 :이 하나가에 대한 몇 가지 정보를 제공하는 주제와 왜

 var myActionSheet = UIAlertController(title: "Delete all data ?", message: "You may not be able to recover this back", preferredStyle: UIAlertControllerStyle.ActionSheet) 
    myActionSheet.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Cancel, handler: nil)) 
    myActionSheet.addAction(UIAlertAction(title: "Delete", style: UIAlertActionStyle.Default, handler: { (ACTION :UIAlertAction!)in 
      println("Deleting the data...") 
     })) 
    myActionSheet.addAction(UIAlertAction(title: "Delete Permanently", style: UIAlertActionStyle.Destructive, handler: { (ACTION :UIAlertAction!)in 
      println("Deleting data permanently...") 
     })) 
    self.presentViewController(myActionSheet, animated: true, completion: nil)