UIAlertView中的时间选择器

Ale*_*ec. 2 uialertview swift3

我需要一个要求输入时间的弹出窗口,我认为可以使用Alertview,但是我不知道从哪里开始将时间选择器嵌入AlertView。

除非有更好的方法可以这样做?

Ale*_*ec. 5

对于其他任何人,我将评论中的问题调整为像这样的时间选择器:

let vc = UIViewController()
vc.preferredContentSize = CGSize(width: 250,height: 300)
let pickerView = UIDatePicker(frame: CGRect(x: 0, y: 0, width: 250, height: 300))
vc.view.addSubview(pickerView)
let editRadiusAlert = UIAlertController(title: "Choose ETA", message: "", preferredStyle: UIAlertControllerStyle.alert)
editRadiusAlert.setValue(vc, forKey: "contentViewController")
editRadiusAlert.addAction(UIAlertAction(title: "Set ETA", style: .default, handler: nil))
editRadiusAlert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil))
self.present(editRadiusAlert, animated: true)
Run Code Online (Sandbox Code Playgroud)