Code Monkey home page Code Monkey logo

oop-cards-simple-views-ios-0616's Introduction

OOP-Cards Simple Views

Objectives

  1. Use Storyboard to layout a view controller
  2. Link labels and buttons in storyboard to a view controller's class file.
  3. Write the implementation for IBActions to change the text displayed in UILabels.

Introduction

In this lab we're going to turn the canvas of a view controller into a representation of a playing card. You'll see that our FICard class has been imported from previous labs, and the FISCardSwitcherViewController is already setting up a few cards for us to use.

Instructions:

Open the OOPCardsSimpleView.xcworkspace file and navigate to the storyboard file. You'll see an empty view controller that's already connected to the FISCardSwitcherViewController class.

  1. Create three UILabels on the view controller canvas:
  • one in the upper-left hand corner,
  • one in the bottom-right hand corner, and
  • one right in the center.
    Leave a little bit of room at the bottom for a row of UIButtons that we'll add later.
  1. Set the accesibility label of each of these UILabels to be topLabel, middleLabel, and bottomLabel respectively. This is how our tests determine which label is which. Set !N as the default text in each. Increase the font size of the middle label to something greater than 40.

  2. Now, add four UIButtons to the bottom of the canvas in a row:

  • set the button title to ♠️3 and the accessibility label to threeOfSpadesButton,
  • set the button title to ♣️4 and the accessibility label to fourOfClubsButton,
  • set the button title to ♦️8 and the accessibility label to eightOfDiamondsButton,
  • set the button title to ♥️10 and the accessibility label to tenOfHeartsButton.
  1. Connect the IBActions for these four buttons and write their implementations so that when one is pressed, all three of the UILabels update their text to show the cardLabel for the card that matches that button. The tests should pass when you have done this correctly.

Note: If you have trouble copy/pasting the suit characters from the README, you can also find them in the test files.

View OOP-Cards Simple Views on Learn.co and start learning to code for free.

oop-cards-simple-views-ios-0616's People

Contributors

chrisgonzgonz avatar markedwardmurray avatar zdrossman avatar mykelp avatar fs-lms-test-bot avatar fislabstest avatar sarogers avatar misterfifths avatar olutosinatflatiron avatar

Watchers

James Cloos 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.