UIPickerView data notshowing in a subview : i have a container view in which i am showing text field  in which picker view is connected . picker view not showing data in container view 

@IBOutlet var txtfield: UITextField!
var pickerView = UIPickerView()

pickerView.delegate = self
        pickerView.dataSource = self

tYear.inputView = pickerViewYear <----- Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value