UIAlertView的使用


func a(){

let alert = UIAlertView(title:"注意", message:"放棄當前修改?", delegate:self, cancelButtonTitle:"取消", otherButtonTitles:"確定")

        alert.show()

  alert.tag111

  alert.show()

}

func alertView(alertView: UIAlertView, clickedButtonAtIndex buttonIndex: Int) {

        if alertView.tag == 111 {

            if buttonIndex == 1 {

                

            }else {

                

            }

            

        }

        

        

    }


UIAlertViewDelegate 代理協議別忘了加上


發佈了32 篇原創文章 · 獲贊 0 · 訪問量 1萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章