Multi Recipient Picker Control - Open Source Code for the iPhone
Jun/Fri/10 11:30
I needed to create a way to select recipients to send information to in a project that Software Ops is working on. What I need was a way to pick either an email address or phone number to send a text message. There is no such control in the iPhone SDKs but Apple’s mail and message app each have a recipient picker that I used to model the behavior of the project that I’ve created here and have made open source. Before I go any further, I must admit that this code currently has some imperfect behaviors, bugs is another way of putting it, but it is very useful as a starting point for anybody who needs such a control.
Here is the URL for the code. It has an MIT license for all to use. Here is a video of a presentation on the Multi Recipient Picker Controller
The Multi Recipient Picker Control allows you to create a list of recipients, as a list of email address or phone numbers that you can use to send information to the select recipients. I will call an email address or phone number a destination. A destination is stored as a string within the MultiRecipientModel. It can be a simple email address like support@softwareops.com or it can be ‘Software Ops Support’ There are methods to access the full string or just the effective destination between the <>s. When you use the multi picker and select a person’s phone number, it stores the number in this format Billy Bob<8005552350>, but it only displays Billy Bob in the picker control. You can also choose to just enter an email address like support@softwareops.com and the will appear in the picker control.

The picker will do a search of your Contacts as you type in a person’s name. It will display a list of matches that you then select and to choose either an email or phone number.



This control was designed to be integrated into a screen that has important content displayed below the picker control. While I’ve been calling this a control, it is really much more that a single control; it is made up of the following view elements

The idea is for you to contain your views within the detailView. If you do this, you will get the pre determined behaviors that closely match Apple multi recipient picker. After I wrote this code within the bounds of the sample app, it only took me 3 hours to integrate it into an existing screen with an existing view controller. The three hours also included some important fine tuning of the code that I back ported to this project. If you integrate the methods of MultiRecipientPickerViewController into an existing view controller and then integrate the views from MultiRecipientPickerViewController.xib you should be up and running in less than an hour.
Good luck with the code. I hope it is useful to you. I would be great to hear from you with bug fixes, ideas and improvements, but please don’t bother with stylistic coding comments. Why? Because one thing that I have learned over 25 years of software development, that coding is an art and most people have a hard time getting into the head of the artist and instead view the art from their perspective; when they do, the can find much to criticize that is counter productive.
Here is the URL for the code. It has an MIT license for all to use. Here is a video of a presentation on the Multi Recipient Picker Controller
The Multi Recipient Picker Control allows you to create a list of recipients, as a list of email address or phone numbers that you can use to send information to the select recipients. I will call an email address or phone number a destination. A destination is stored as a string within the MultiRecipientModel. It can be a simple email address like support@softwareops.com or it can be ‘Software Ops Support


The picker will do a search of your Contacts as you type in a person’s name. It will display a list of matches that you then select and to choose either an email or phone number.



This control was designed to be integrated into a screen that has important content displayed below the picker control. While I’ve been calling this a control, it is really much more that a single control; it is made up of the following view elements


The idea is for you to contain your views within the detailView. If you do this, you will get the pre determined behaviors that closely match Apple multi recipient picker. After I wrote this code within the bounds of the sample app, it only took me 3 hours to integrate it into an existing screen with an existing view controller. The three hours also included some important fine tuning of the code that I back ported to this project. If you integrate the methods of MultiRecipientPickerViewController into an existing view controller and then integrate the views from MultiRecipientPickerViewController.xib you should be up and running in less than an hour.
Good luck with the code. I hope it is useful to you. I would be great to hear from you with bug fixes, ideas and improvements, but please don’t bother with stylistic coding comments. Why? Because one thing that I have learned over 25 years of software development, that coding is an art and most people have a hard time getting into the head of the artist and instead view the art from their perspective; when they do, the can find much to criticize that is counter productive.