Coder Social home page Coder Social logo

swift-uilab03-lab-nyc-web-111819's Introduction

UI Lab: Cards

Walt Whitman

Keep your face always toward the sunshine - and shadows will fall behind you. ~Walt Whitman

Cards

In this lab, you will create an app that will draw a card on screen in response to button presses.

When the user first loads your app, its UI will look like this:

Cards UI

Pressing buttons will change the labels in the corners and the middle. The labels in the corner should be updated with the suit of the card (♠️, ♣️, ♦️, and ♥️), and the label in the middle should be updated with the value (4, 3, 8, 10). For example, when the user presses the first button, the UI should look like this:

Cards UI

Easy, right?

A basic Xcode project has been started for you, and can be in this repo at Cards.xcodeproj. Notice, however, that the app is nearly empty. To paraphrase a famous Game of Thrones quote, in this lab, "You get nothing, Jon Snow!" You will have to implement this entire app from scratch (aside from the basic view controller and storyboard that has been given to you in the Xcode project). However, unlike Jon Snow, you do know something—a lot, actually—so this lab should be a breeze.

Instructions

Here's what you'll need to do to complete this lab:

  1. Create a label in the top left and bottom right corner of the app view. You might want to bump the text size up to 28 pt. (Don't forget about the Attributes Inspector!)
  2. Add a label to the center of the view. Its text size should be 40 pt.
  3. Create four buttons with the following labels: ♣️4, ♠️3, ♦️8, ♥️10.
  4. Hook these buttons up to IB actions. You can hook them each up to their own IB action, or just have one single IB action that they are all attached to—your choice.
  5. When a button is pressed, update the labels accordingly (the ones in the corner should display the suit and the one in the center should display the value).

Good luck!

View this lesson on Learn.co

swift-uilab03-lab-nyc-web-111819's People

Contributors

jimcampagno avatar mdippery avatar annjohn avatar

Watchers

James Cloos avatar  avatar Mohawk Greene avatar Victoria Thevenot avatar Bernard Mordan avatar Otha avatar raza jafri avatar  avatar Joe Cardarelli avatar The Learn Team avatar  avatar  avatar Ben Oren avatar Matt avatar Antoin avatar Alex Griffith avatar  avatar Amanda D'Avria avatar  avatar Ahmed avatar Nicole Kroese  avatar Kaeland Chatman avatar  avatar Lisa Jiang avatar Vicki Aubin avatar Maxwell Benton 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.