ios - Save the value in UIpickerview once done editing -


i need number 4.

  1. select uitextfield , show uipickerview (check)
  2. select value in uipickerview , display in uitextfield (check)
  3. click on screen , move focus uitextfield , uipickerview disappear (check)
  4. click on uitextfield , displays selected value in uitextfield uipickerview starting point (row 0).

here code:

 @ibaction func textfieldediting(sender: uitextfield){     var numberpicker:uipickerview = uipickerview()     var row:int = 0     numberpicker.delegate = self     desiredtext?.inputview = numberpicker     numberpicker.selectrow(79, incomponent: 0, animated: true)     //desiredtext?.text = pickoption[79] }   func numberofcomponentsinpickerview(pickerview: uipickerview) -> int{     return 1 }  func pickerview(pickerview: uipickerview, numberofrowsincomponent component: int) -> int{     return pickoption.count }  func pickerview(pickerview: uipickerview, titleforrow row: int, forcomponent component: int) -> string! {     return pickoption[row] }  func pickerview(pickerview: uipickerview, didselectrow row: int, incomponent component: int){     desiredtext!.text = pickoption[row] } 


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -