[Solved] Show Array of String in Picker View? [closed]

func numberOfComponents(in pickerView: UIPickerView) -> Int { return 1 // the amount of “columns” in the picker view } func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { return yourArray.count // the amount of elements (row) } func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { return yourArray[row] // the … Read more

[Solved] How to use UIPickerView to show date months and Year(Upto 2015)?

It is as simple as that just copy paste this code in your viewdidload. Here in this code the setMaximumDate set the what you want for. That will be your Max Date. Here in this piece of code I used max date as TODAYS DATE. UIDatePicker *datePicker = [[UIDatePicker alloc]init]; datePicker.datePickerMode = UIDatePickerModeDate; [datePicker setMaximumDate:[NSDate … Read more

[Solved] Swift – how to read data from many UITextFields which generate data by UIPickerView [closed]

You can set a pickerView as the textField.inputView. The example below is for two text fields sharing a single picker view, but you can extend it easily by checking the identity of the activeTextField in the picker view delegate methods. import UIKit class ViewController: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource { @IBOutlet weak var myTextFieldOne: UITextField! @IBOutlet weak … Read more

[Solved] Picker View uncaught exception SWIFT

The first problem is that you don’t store the created picker view instance. You instantiate it inside of a function, assign the delegate and dataSource and then you don’t store it in your class. So the ARC (Automatic Reference Counting) releases it, because it thinks the instance is not longer needed. Just create a variable … Read more

[Solved] How to change UIPickerView image

i have tried this code [[[self._picker1 subviews] objectAtIndex:3] setAlpha:0.0]; // this view contains the background so you can change it with your new background // object at index 4 is your labels or images so they must be shown [[[self._picker1 subviews] objectAtIndex:5] setAlpha:0.0]; [[[self._picker1 subviews] objectAtIndex:6] setAlpha:0.0];// this is you indicator , you can add … Read more