Mobile App Dev 2021W: Assignment 1

From Soma-notes
Revision as of 10:58, 27 January 2021 by Soma (talk | contribs) (Created page with "'''This assignment is still being developed.''' ==Questions== <ol> <li>[3] Change getConversion in main.swift as follows: <ol style="list-style-type:lower-alpha"> <li>[1] Ma...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This assignment is still being developed.

Questions

  1. [3] Change getConversion in main.swift as follows:
    1. [1] Make getConversion follow function rather than closure syntax.
    2. [2] Remove the ! in line 23 and fix the code. If you add a conditional, be sure it has an else clause that does something sensible (other than nothing).
  2. [2] Change the conversions in ContentView.swift so that the just the result is displayed in bold (the number and the unit).
  3. [1] Rewrite the for loop in lines 7-9 of getChoice() in main.swift to use forEach().
  4. [7] Change the conversions so they each have a default for the from value.
    1. [2] Change the Converter struct to take this default from value when constructed, and add a default value to each of the conversions.
    2. [1] Make it so that in ContentView.swift, when first displaying a conversion it displays the default value and what it converts to.
    3. [2] Add a message, displayed at a nice spacing belowe the conversion that says "Please enter your own number to convert." in italics. This message should only be shown when the default value is being converted. It should be in a separate view.
    4. [2] How quickly does the above message disappear when you enter a new number? When does your new view have to be run in order to make this happen when it does?