1

Is there any way to remove Select string from top of the UIPickerView screen shot given below:

Screen Shot

Code:

var pickerVWUserList = UIPickerView() 

    //MARK:- Setup Picker View For TextField
func setupForPickerViewForTxtFld() {
    pickerVWUserList.delegate = self
    pickerVWUserList.dataSource = self
    txtfldAllGroup.inputView = pickerVWUserList
}

//MARK:- Extension for picker View
extension VC:UIPickerViewDataSource,UIPickerViewDelegate {
func numberOfComponents(in pickerView: UIPickerView) -> Int {
    return 1
}

func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
    return listOfAllTypesGroups.count
}

func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
    return listOfAllTypesGroups[row].groupName
}

func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
    slctedGroupId = listOfAllTypesGroups[row].groupId
}

Thank you

Anbu.Karthik
  • 82,064
  • 23
  • 174
  • 143
Sham Dhiman
  • 1,348
  • 1
  • 21
  • 59

1 Answers1

1

Try this code in AppDelegate didFinishLaunchingWithOptions

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

     IQKeyboardManager.shared.enable = true
     IQKeyboardManager.shared.shouldShowToolbarPlaceholder = false

     return true
 }
Zain Ul Abideen
  • 693
  • 10
  • 15