UIAlertView(已经过时) UIActionView swift
2016-12-16 23:34
204 查看
//
// ViewController.swift
// UILabelTest
//
// Created by mac on 15/6/23.
// Copyright (c) 2015年 fangyuhao. All rights reserved.
//
import UIKit
class ViewController: UIViewController,UIActionSheetDelegate {
// alertView.show()
}
// ViewController.swift
// UILabelTest
//
// Created by mac on 15/6/23.
// Copyright (c) 2015年 fangyuhao. All rights reserved.
//
import UIKit
class ViewController: UIViewController,UIActionSheetDelegate {
override func viewDidLoad() { super.viewDidLoad() var alertView = UIAlertView() alertView.title = "系统提示" alertView.message = "确认删除?" alertView.addButtonWithTitle("取消") alertView.addButtonWithTitle("确认") alertView.cancelButtonIndex = 0 alertView.delegate = self;
// alertView.show()
//操作表 var actionSheet = UIActionSheet() actionSheet.addButtonWithTitle("取消") actionSheet.addButtonWithTitle("动作1") actionSheet.addButtonWithTitle("动作2") actionSheet.cancelButtonIndex = 0 actionSheet.delegate = self actionSheet.showInView(self.view) // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } func alertView(alertView:UIAlertView,clickedButtonAtIndex buttonIndex:Int){ if(buttonIndex==alertView.cancelButtonIndex){ println("点击了取消") }else{ println("点击了确认") } } func actionSheet(actionSheet:UIActionSheet!,clickedButtonAtIndex buttonIndex:Int){ println("点击了:"+actionSheet.buttonTitleAtIndex(buttonIndex)) }
}
相关文章推荐
- 苹果开发 笔记(85)UIActionSheet 和UIAlertView 已经失效
- Swift基础(二十二)UIAlertView,UIActionSheet,UIAlertController
- swift学习之-- UIAlertVIewController - uiactionsheet
- Swift UIAlertView/UIActionSheet
- iOS学习笔记—— UIAlertView 和 UIActionSheet 的使用
- ios-消息弹框之UIAlertView, UIActionSheet以及UIAlertController小结
- UIAlertView和UIActionSheet的IOS8兼容
- UIActionSheet,UIAlertView,UISlider,UIProgressView,UISwitch,UISegmentControl,UIActivityIndicatorView基
- Swift - 告警框(UIAlertView)的用法
- UIAlertController的使用,代替UIAlertView和UIActionSheet
- UI29_UIAlertAction(UIAlertView和UIActionSheet的结合体)
- ios开发swiftUIAlertView
- 【IOS 开发学习总结-OC-47】★ios开发之UI控件——UIAlertView与 UIActionSheet
- 如何自定义UIActionSheet(UIAlertView)中的内容
- UIAlertView、UIActionSheet兼容iOS8
- UIAlertView,UIActionSheet, UIMenuController
- iPhone起步-2:iPhone常用控件、UIActionSheet、UIAlertView (转)
- 谈谈改变 UIAlertView 和 UIActionSheet 的颜色 iOS8及以上应该使用的方式
- iOS开发之如何自定义UIActionSheet(UIAlertView)中的内容
- UIAlertController UIAlertAction (UIAlertView, UIActionSheet)(最好)