Swift和简单弹出对话框:DOAlertController

jopen 9年前

简单的Alert视图,采用 Swift 开发,可用作 UIAlertController 的一个替代。它支持iOS7,它简单并且易于定制。
Swift和简单弹出对话框:DOAlertController Swift和简单弹出对话框:DOAlertController

Easy to use

DOAlertController can be used as aUIAlertController.

// Set title, message and alert style  let alertController = DOAlertController(title: "title", message: "message", preferredStyle: .Alert)    // Create the action.  let cancelAction = DOAlertAction(title: "OK", style: .Cancel) { action in      NSLog("The simple alert's cancel action occured.")  }    // Add the action.  alertController.addAction(cancelAction)    presentViewController(alertController, animated: true, completion: nil)

Customize

see DOAlertController-DEMO for details

  • change Fonts
  • change color (Background, View, Buttons)
  • add TextField (Alert style only)

Swift和简单弹出对话框:DOAlertController Swift和简单弹出对话框:DOAlertController

项目主页:http://www.open-open.com/lib/view/home/1434418327864