Q:

What is the design pattern being used in this video?

I recently watched this video tutorial on how to create a custom UIPickerView, and I successfully implemented the UIPickerView in my project.  However, I would like to make some changes to the UIPickerView that appears within my app.
For starters, is the custom UIPickerView outlined in the video an example of subclassing?
Second, is it possible to modify an instace of the custom UIPickerView to have a different text label other than Done?  And if so, would I have to modify the KCModalPicker.h/m files?
Thus bringing me to my third question, if I modify the KCModalPicker.h/m files then every other instance of the class in my project will inheret the changes, so what is a way to keep the base class as is, but be able to add customization to the class, so things like how many columns the UIPickerView has is dependant upon the instance that is obstantiated, and not dependant upon the KCModalPicker.h/m files?
UPDATE
The source for the ModalPicker class I am referring to, can be found here,
https://github.com/subdigital/nsscreencast/tree/master/025-custom-picker-component-part-1

A:

I don't want to watch a video in order to answer your question, and suspect others feel the same way. (I hate watching development videos because they are long and tedious. I don't need somebody explaining in great and painful detail how to do something. Let me skip to the parts I'm interested in.) You should describe the scheme that is used so that we can answer your questions about it.
If that video describes a class KCModalPicker, it might subclass UIPickerView, or it might contain a picker view (that would be a "has-a" relationship, not an "is-a" relationship. The KCModalPicker is probably a modal view controller that has a picker view inside it.)
If you want to modify a class, like KCModalPicker, but don't want to change all instances, then yes, subclassing would probably be a good way to go. Create a subclass called something like MyModalPicker that inherits from KCModalPicker and changes the behavior however you need it to.
EDIT:
After looking at the files on Github, it looks like the project has a class BSModalPickerView which is a subclass of UIView, and contains a UIPickerView. As described above, this is a "has-a" relationship. The BSModalPickerView class has a picker view inside it that it manages. So no, this project does not appear to use subclassing.
The demo program has a view controller that uses the BSModalPickerView method presentInView:withBlock: that displays the picker as a subview of the view controller's main view.
It looks like there is also a method presentInWindowWithBlock: that will display the picker view directly in the window.
If you want to modify the behavior of some BSModalPickerViews and leave others alone, creating your own custom subclass of BSModalPickerView would be a reasonable way to do that. You could also modify the root BSModalPickerView to have more setup options (extra properties or parameters that you pass in the init method).
BTW, your question asks about KCModalPicker.h, but the class I see in the github link you posted is BSModalPickerView. Not sure what the discrepancy is.

