I am trying to use a calculator as a custom input view to an UITextField in swift.
I have a calculator separately defined in my app as CalculatorViewController.
I need to access the CalculatorViewController in the UITextField I have in my InputViewController.
I defined the following property in the InputViewController to access the calculator view
var textFieldInputView : UIView!{
let calculatorInputController = self.storyboard?.instantiateViewControllerWithIdentifier("calculatorVC") as! calculatorViewController
let calculatorInputView = calculatorInputController.view
return calculatorInputView
}
then added following code in the textField to access the textFieldInputView
textField.inputView = textFieldInputView
Now when I click the textField, the calculator popup,as per the below, which is not in the position where keyboard appears. Also none of the buttons working.
Much appreciated if some one could advise me how to get this fixed.