Posts

Post marked as solved
21 Replies
How are you sure textDidBeginEditing is not called at all ?console log didn't print for me.Now I am not able to recreate the issue in the release scheme. Now it's working as expected.Not sure how it got fixed. maybe switching between schemes?Have you ever faced similar issues in the past due to any scheme/target issues?
Post marked as solved
21 Replies
So, this delegate func is not called at all ?Did you insert a log (write this to a temporary label to insert in view) to test inputView ?textDidBeginEditing is not called at all.I have added a logging statement inside textDidBeginEditing() to print the inputview which didn't execute.
Post marked as solved
21 Replies
Tried setting the input View and accesssoryView for the 3 textFields in viewDidload instead of textDidBeginEditing.With that picker view displayed on the screen successfully but again textDidBeginEditing() is not invoked where we set the activeTextField.Due to that pickerDoneTapped() won't work as it's based on activeTextField check and we have some logic to populate screen fields.A little story behind the actual issue.I am new to IOS development.Initially, when I started the project, all the schemes were set to Debug and I was testing with that including ipa installation & everything works fine. Somehow with my last ipa creation, the problem started where pickerview was not showing for almost all the pages.Due to this issue, I noticed the archive scheme was how set to release.Whereas simulator/direct phone installation works fine with the same build. ( scheme = Debug)When I switched back the archive scheme Release to Debug, it started working again.We need to use a release scheme for the production build. Please correct me if I'm wrong?I think the issue lies between the archive Debug vs Release scheme.Is there any difference in the settings which I need to take care?
Post marked as solved
21 Replies
do not find addToolBarHandler anywhere.Is it a func of your own ?Yes. Used across my application for picker viewextension UIToolbar{ func addToolBarHandler(selectorDone : Selector , selectorCancel : Selector) -> UIToolbar{ let toolBar = UIToolbar() toolBar.barStyle = UIBarStyle.default toolBar.isTranslucent = true let doneButton = UIBarButtonItem(title: "Done", style: UIBarButtonItem.Style.done, target: self, action: selectorDone) let cancelButton = UIBarButtonItem(title: "Cancel", style: UIBarButtonItem.Style.plain, target: self, action: selectorCancel) let spaceButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.flexibleSpace, target: nil, action: nil) toolBar.setItems([cancelButton, spaceButton, doneButton], animated: false) toolBar.isUserInteractionEnabled = true toolBar.sizeToFit() return toolBar } } Why do you repeat the test line 8. Seem to be the same than line 4. Isn't it ?As I mentioned, I have other Pickerviews to check in those linesfunc textFieldDidBeginEditing(_ textField: UITextField) { activeTextField = textField self.selectedItem = "" if (activeTextField == selectAccountTB || activeTextField == selectPayeeXXXTB || activeTextField == selectXXXAccountTB) { let toolBar = UIToolbar.init().addToolBarHandler(selectorDone: #selector(pickerDoneTapped), selectorCancel: #selector(pickerCancelTapped)) self.activeTextField.isUserInteractionEnabled = true self.activeTextField.inputAccessoryView = toolBar if (self.activeTextField == self.selectAccountTB ) { self.activeTextField.inputView = self.accountPickerView } else if(self.activeTextField == self.selectPayeeXXXTB ) { self.activeTextField.inputView = self.selectPayeeXXXPickerView } else if(self.activeTextField == self.selectXXXAccountTB ) { self.activeTextField.inputView = self.XXXAccountPickerView } } }
Post marked as solved
21 Replies
The difference could be in the info.list --><key>UIStatusBarHidden</key> <true/> is the only difference I could seeDid you select none for app thinning ?Yes. None is selected alwaysCode Snippet@IBOutlet weak var selectAccountTB: DesignableTextField!where DesignableTextField extends UITextFieldvar accountPickerView = UIPickerView()I have 3 picker views. Listed only 1 herefunc textFieldDidBeginEditing(_ textField: UITextField) { activeTextField = textField self.selectedItem = "" if (activeTextField == selectAccountTB ) { let toolBar = UIToolbar.init().addToolBarHandler(selectorDone: #selector(pickerDoneTapped), selectorCancel: #selector(pickerCancelTapped)) self.activeTextField.isUserInteractionEnabled = true self.activeTextField.inputAccessoryView = toolBar if (self.activeTextField == self.selectAccountTB ) { self.activeTextField.inputView = self.accountPickerView } } }extension QTPViewController : UIPickerViewDelegate , UIPickerViewDataSource { func numberOfComponents(in pickerView: UIPickerView) -> Int { return 1 } func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { var count = 1 if self.activeTextField == self.selectAccountTB { count = self.accountList.count } else if self.activeTextField == self.selectPayeeBankTB { count = self.payeeBankValueList.count } return count } func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { var rowValue:String! if self.activeTextField == self.selectAccountTB { rowValue = self.accountList[row] } else if self.activeTextField == self.selectPayeeBankTB { rowValue = self.payeeBankValueList[row] } return rowValue } func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int){ if self.activeTextField == self.selectAccountTB { if (!accountList.isEmpty) { self.selectedItem = self.accountList[row] print("Selected Item " , self.accountList[row]) } } } }
Post marked as solved
21 Replies
Thanks Claude for looking into it. updated my answersProduct-> Clean Build Folder didn't help me 😟 so far.Which iOS version?IOS version : 12.4.2 iPhone 6Everything works fine if I install directly on phone/simulator. If I use ipa install, keyboard opens instead of pickerview for few view controllers.IOS version : 13.1.3 iPhone 8 PlusIf I use ipa install, keyboard opens instead of pickerview for few view controllers.Do you mean textFieldDidBeginEditing is no more called ?Yes. textFieldDidBeginEditing is not called for the affected view controllers.Have you changed something in code ? If you revert to an older backup, do you see the problem?Re-designed completely for that view controller. Still no luck with ipa install.Also tried with an old backup(taken on Oct23rd) where ipa install works fine with that.