Quantcast
Channel: Active questions tagged uipickerview - Stack Overflow
Viewing all articles
Browse latest Browse all 592

Populate UIPickerView data using http request

$
0
0

I have this UIPickerView which will have data yet, but doesn't have data, since I make async http request

func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {        var dataCount = PickerData.count        return dataCount    }

happens before my data is loaded, how do I populate my PickerData after this function happens? I couldn't find any answers on any website, maybe I'm searching for wrong terms but still, i couldn't do it, i thought about making sync request, but I've read that it is a bad practice, so is there a good way to solve my problem?

Also I want to add, the data might change over time so I want to be able to change PickerView data too.


Viewing all articles
Browse latest Browse all 592

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>