Swift和簡單彈出對話框:DOAlertController

jopen 9年前發布 | 53K 次閱讀 iOS開發 移動開發 DOAlertController

簡單的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.baiduhome.net/lib/view/home/1434418327864

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!