Md Ibrahim Hassan Md Ibrahim Hassan - 1 month ago 6
iOS Question

Show a Custom View on textField tap just as we show a picker in the place of keyboard

The View is not showing on tap the code is as given below

let myTFrame = CGRectMake(0, 0, DC.screenWidth/2-53, 30)
myT = UITextField(frame: myTFrame)
myT.delegate = self
myT.textAlignment = .Right
myT.text = "תת קטגוריה"
myT.textColor = .grayColor()
myT.delegate = self
myT.inputView = tempView
view.addSubview(myT)

Answer
let myTFrame = CGRectMake(0, 0, DC.screenWidth/2-53, 30)
myT = UITextField(frame: myTFrame)
myT.delegate = self
myT.textAlignment = .Right
myT.text = "תת קטגוריה"
myT.textColor = .grayColor()
myT.delegate = self
tempView.frame = CGRectMake(0, 0, 320, 256)
myT.inputView = tempView
view.addSubview(myT)