Search code examples
iphoneiosxcode4

Nice buttons like these in Xcode 4.2


I am trying to make nice looking user input buttons for my app. Just like the ones shown in the screenshot below. I looked into IBAForms but that project is not only super complicated to incorporate in your app but also it has complier issues left and right with Xcode 4.2. So I gave up on that idea.

If I want to use just Xcode 4.2 built in technology, how can I achieve these kinds of buttons relatively easily? meaning

How can I create a button with Text and user selected values as shown in this screenshot? I am sure there are multiple ways of going about it.

enter image description here


Solution

  • The simplest way to achieve this is as follows. You don't need any external libraries.

    • Create a new application using storyboards
    • Add a table view controller
    • Set the type to "static content"
    • Set the number of sections you want in the inspector - a section is a group of cells that are grouped together. Your example has 5 sections visible.
    • Drag in some cells - play around with the types to see what you get, for example the first one is a default type with a "detail disclosure button" accessory view, the second groups are "detail right" (or similar) stype with a disclosure accessory view.

    Done!