How to make custom control?

Discussion in 'iOS Programming' started by Sergio10, Aug 27, 2009.

  1. Sergio10 macrumors regular

    Oct 3, 2007

    I need to develop all custom controls in application.
    I'd like to implement UISwitch control for the first time.

    Could you please explain how to do it? Maybe you have some tutorials on this?

  2. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    What do you mean by "all"? Every single one of your controls? And what do you mean by "custom"?

    By the way, UISwitch is not a custom control. It's a standard one.

    As for tutorials:
  3. icewing macrumors 6502

    Jun 19, 2008
    St Louis
    @ dejo - awesome!! Sometimes it's hard to be civil when lots of these questions can be answered simply with RTFM - nicely done!
  4. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    Sergio, are you asking how to make a set of controls that look different from the standard controls? Depends and may not be so easy. A switch is maybe the simplest of controls so a good place to start. It basically is a control that has two appearances. Tap it and it toggles between the two appearances.

    Look at the Apple example code called Accessory. It shows how to have an accessory in a table view that toggles between two appearances. Unfortunately it doesn't create a UIControl subclass. That's what you should do. Start with UIControl and build a switch.

Share This Page