Open LukeSmith16 opened 7 years ago
regards! I used this solution
//quit done button
let appearance = SCLAlertView.SCLAppearance(
showCloseButton: false
)
//init sclalertview object
let alert = SCLAlertView(appearance: appearance)
let subview = UIView(frame:CGRect(x: 0, y: 0, width: 120, height: 90))
let picker = UIPickerView()
picker.frame = CGRect(x: 0, y: 0, width: 120, height: 90)
picker.delegate = alert
subview.addSubview(picker)
alert.customSubview = subview
alert.showTitle(
NSLocalizedString("title",comment:""),
subTitle: NSLocalizedString("text",comment:""),
style: .success,
colorStyle: 0xCE2200,
colorTextButton: 0xFFFFFF
)
you must also create this extension
extension SCLAlertView: UIPickerViewDataSource, UIPickerViewDelegate{
public func numberOfComponents(in pickerView: UIPickerView) -> Int {
return 1
}
public func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
return 10
}
public func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
return "First \(row)"
}
}
work perfectly how to get which elements select in pickerview? thank
How do i go about embedding a uipickerview into a custom alert? Is it possible? Thanks