CooperRS / RMPickerViewController

This is an iOS control for selecting something using UIPickerView in an UIAlertController like manner
MIT License
381 stars 51 forks source link

Name the Rows #16

Closed bnelson796 closed 9 years ago

bnelson796 commented 9 years ago

How would you custom name the rows? i.e. If i wanted 4 constant strings that will never change? Instead of (Row 0, Row 1, etc) to (House, Apartment, etc). THanks!

CooperRS commented 9 years ago

You may want to take a look at the demo project. There you will find the class RMDemoViewController. This class implements the RMPickerViewControllerDelegate Protocol which also requires you to implement the UIPickerViewDelegate and UIPickerViewDataSource Protocols.

So in your RMPickerViewController delegate you can implement the standard UIPickerViewDataSource methods like numberOfComponentsInPickerView:, pickerView:numberOfRowsInComponent: and pickerView:titleForRow:forComponent:.

With these methods you have full control over what is being displayed within the picker view :).

CooperRS commented 9 years ago

Did this work?

bnelson796 commented 9 years ago

Worked great!! Thanks for your help!

Brad

From: Roland Moers notifications@github.com Reply-To: CooperRS/RMPickerViewController <reply+005e96a428a752193f4872598b14a6c057f406a3c198210f92cf00000001109de5cb 92a169ce030d4f90@reply.github.com> Date: Monday, December 8, 2014 at 4:18 PM To: CooperRS/RMPickerViewController RMPickerViewController@noreply.github.com Cc: Brad Nelson brad@bagsb.com Subject: Re: [RMPickerViewController] Name the Rows (#16)

Did this work?

— Reply to this email directly or view it on GitHub.