검색결과 리스트
UIActionSheet에 해당되는 글 1건
- 2017.12.04 [swift][3.x]UIAlertController usage
uiactionsheet deprecated at iOS8
so we have to change uiaction sheet to uialertcontroller
<example at UIViewController>
let alertController = UIAlertController(title: "등록된 혈당측정기를 삭제하시겠습니까?".localized, message: "", preferredStyle: .alert)
let confirmAction = UIAlertAction(title: "확인".localized, style: .default, handler: { (action) -> Void in
//do something
})
let cancelAction = UIAlertAction(title: "취소".localized, style: .cancel, handler: { (action) -> Void in
//self.tableView.setEditing(
})
alertController.addAction(
alertController.addAction(
self.present(alertController, animated: true, completion: { () -> Void in
//do something
})
func selecttypeitem(action : UIAlertAction){
var buttonIndex:Int = 0
for title in self.termTitles {
if(action.title == title)
{
break
}
buttonIndex = buttonIndex + 1
}
}
<example at UIView>
self.present to use like below
UIApplication.shared.keyWindow
* we cant use sender.tag
* we can use only one action type cancel! if you add multiple cancel action, it will occur exception!
RECENT COMMENT