Create Uiactionsheet
Be sure to indicate the type. Do not compile does not pass
Func Actionsheet (Sender:uitapgesturerecognizer)
??? {
??????? Let Actionsheet:uiactionsheet = Uiactionsheet (title: "Is you sure?", Delegate:self, Cancelbuttontitle: "Cancel", Destructivebuttontitle: "Yes,i ' m sure!");
??????? Actionsheet.showinview (Self.view)
?????? ?
??? }
Actionsheet delegate
??? Func Actionsheet (Actionsheet:uiactionsheet, Clickedbuttonatindex buttonindex:int) {
??????? if Buttonindex = = 0{
??????????? println ("Click location for \ (Buttonindex)")
??????? }
??? }
Create Uialertview
Func Firstswift (Sender:uibutton)
??? {
?????? println ("Click event for First button")
?????? Self.label1.text = "button clicked"
?????? var alert = Uialertview (title: "?", Message: "Button clicked", Delegate:self, Cancelbuttontitle: "Yes")
?????? Alert.show ()
??? }
Swift creates the first Uialertview and Uiactionsheet