Skip to content

UIAlertView

用于显示警告框和确认框。推荐使用带 TapBlock 的类方法,在回调中根据 buttonIndex 处理(0 为第一个 other 按钮,-1 为取消)。

方法参数返回值说明
showWithTitleMessageStyleCancelButtonTitleOtherButtonTitlesTapBlock(title, message, style, cancelButtonTitle, otherButtonTitles, tapBlock)title, message: string;style: number(0 默认);cancelButtonTitle: string;otherButtonTitles: string[];tapBlock: (alert, buttonIndex) => voidinstancetype显示弹窗,点击后回调;buttonIndex 为 0,1,… 对应 other 按钮,-1 为取消。
makeWithTitleMessageDelegateCancelButtonTitleOtherButtonTitles(title, message, delegate, cancelButtonTitle, otherButtonTitles)title, message, delegate(可为 null), cancelButtonTitle, otherButtonTitles: arrayid创建实例,需再调用 show()。
方法说明
show()显示弹窗。
dismissWithClickedButtonIndexAnimated(buttonIndex, animated)关闭。
textFieldAtIndex(textFieldIndex)若 style 为带输入框,可获取 UITextField。