Git Product home page Git Product logo

unit-1-hw-week-4's Introduction

Option Selector

Summary

Create a simple app with a few different categories (dogs, cars, food, planets, etc). When you tap on a category name it should take you into another UITableViewController with a list of possible options. Tapping on an option will show a checkmark at the right of the cell, and remove any other checkmarks on any other cells. When you navigate back to the initial UITableViewController you should see the option that you chose next in the corresponding cell. That is all.

You may pick any categories that you want.

image

Organization

This is a suggestion for how to organize your data.

  1. Each category is represented by a class, let's call it CQCategory. This class has 3 properties: name (NSString*), options (NSArray*), selection (NSString*)
  2. In your root UITableViewController, add a property that is an NSArray that can hold all of your CQCategory objects.
  3. In prepareForSegue, pass the corresponding CQCategory object to the destination UITableViewController

Process

  1. Start simple. In your storyboard, drag out a UINavigationController with UITableViewController as the root view controller. Add an additional UITableViewController. Create a segue when the user taps on a cell in the first UITableViewController.
  2. Set up your data.
  3. Populate your first UITableViewController based on the data that you set up.
  4. Make sure that navigating between UITableViewControllers is working. You'll need to pass relevant information to the second UITableViewController in prepareForSegue:
  5. Set up the selection interaction in the second UITableViewController. You'll need to implement on of the UITableViewDelegate methods. The checkmark is cell.accessoryType, so it's built in.
  6. When selection is made on a cell, update the corrosponding objects selection property.
  7. Make sure that the cells in the first UITableViewController are displaying the selection property.

:) :) :)

unit-1-hw-week-4's People

Contributors

mikekavouras avatar ericfsod avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.