ios - UITEXTFIELD InputView Uipicker not working in swift -


hello trying pop uipickerview view programmatically when user clicks on textfield. have tried doesn't doing anything. isn't working. nothing happening when click textfield

class userprofiletableviewcontroller: uitableviewcontroller,uitextfielddelegate,uipickerviewdelegate,uipickerviewdatasource {  var itempicker: uipickerview! = uipickerview()      @iboutlet weak var gendertxtfield: uitextfield!       var gender = ["male","female"]     override func viewdidload() {         super.viewdidload()           gendertxtfield.delegate = self        itempicker!.delegate = self         itempicker!.datasource = self         itempicker!.backgroundcolor = uicolor.blackcolor()           self.gendertxtfield.inputview = itempicker          }         func numberofcomponentsinpickerview(pickerview: uipickerview) -> int{         return 1     }      // returns # of rows in each component..     func pickerview(pickerview: uipickerview, numberofrowsincomponent component: int) -> int{         return gender.count     }      func pickerview(pickerview: uipickerview, titleforrow row: int, forcomponent component: int) -> string? {         return gender[row]     }      func pickerview(pickerview: uipickerview, didselectrow row: int, incomponent component: int)     {         gendertxtfield.text = gender[row]         //.hidden = true;     }      func textfieldshouldbeginediting(textfield: uitextfield) -> bool {         itempicker.hidden = false         return false     }      override func didreceivememorywarning() {         super.didreceivememorywarning()         // dispose of resources can recreated.     }   } 

the issue in current code in method:

func textfieldshouldbeginediting(textfield: uitextfield) -> bool {     itempicker.hidden = false      return false // <--- not letting textfield become editable } 

i suggest removing method entirely.


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -