Open knight6700 opened 2 years ago
let pickerView = UIPickerView() pickerView.delegate = self picker = UIPickerView.init() picker.delegate = self picker.dataSource = self picker.backgroundColor = UIColor.white picker.setValue(UIColor.black, forKey: "textColor") picker.autoresizingMask = .flexibleWidth picker.contentMode = .center picker.frame = CGRect.init(x: 0.0, y: UIScreen.main.bounds.size.height - 300, width: UIScreen.main.bounds.size.width, height: 300)
i think we can make it better like : lazy var pickerView: UIPickerView = { let pickerView = UIPickerView() pickerView.delegate = self picker = UIPickerView.init() picker.delegate = self picker.dataSource = self picker.backgroundColor = UIColor.white picker.setValue(UIColor.black, forKey: "textColor") picker.autoresizingMask = .flexibleWidth picker.contentMode = .center picker.frame = CGRect.init(x: 0.0, y: UIScreen.main.bounds.size.height - 300, width: UIScreen.main.bounds.size.width, height: 300) return pickerView }() what's your opinion
This is added as a place holder for UI Picker and will work continue on it already
i think we can make it better like : lazy var pickerView: UIPickerView = { let pickerView = UIPickerView() pickerView.delegate = self picker = UIPickerView.init() picker.delegate = self picker.dataSource = self picker.backgroundColor = UIColor.white picker.setValue(UIColor.black, forKey: "textColor") picker.autoresizingMask = .flexibleWidth picker.contentMode = .center picker.frame = CGRect.init(x: 0.0, y: UIScreen.main.bounds.size.height - 300, width: UIScreen.main.bounds.size.width, height: 300) return pickerView }() what's your opinion