Вы находитесь на странице: 1из 6

Task 1: 1

Task 2 : 3
Part 2: 4
Task 3 : 6

Task 1:
Implement an application that represents a human face as
shown below.
Only use autolayout and make sure that when rotated it
has the same proportions as described.
Task 2 :
Implement single view application, that has 3 components-
a textfield, label and a “Hello Button”. When started the
text field and the labels are empty. The button has a title
“Hello”. The user can write his/her name in the textfield. If
the user taps the button, the label is updated with the text:
“Hello, <the name in TextField>”.
Use autolayout for any UI elements. The application
should look like this:

Part 2:
Make an additional TextField under the one for your name
with placeholder : “Password”. This text field will be used
for logging the user.
Instead of “Hello” button, you will now have a “Login” and
“Register” buttons. They have to be placed next to each
other(horizontally). The margins on left and the right have
to be equal to the space between the two buttons.

When the user enters name and password and taps on


“Login”, the app checks if a user with that name exist and
if the password is correct. If you login successfully, the
label states “Logged in as <name>”, the Login and
Register buttons are hidden and a new button “Logout”
appears. Tapping it clears the logged state and restores
the Login and Register buttons.
If the user taps on “Register”, the user and password are
saved and you can afterwards log in with these credentials

Lastly: If you’re logged in and kill the app, then relaunch it,
the user is still logged in. If you register some users, and
you kill the app, they’re still registered on next launches.
(tip: use UserDefaults to save the data)

Task 3 :
Implement single view application, that calculates the price
of desired products. This single view consist of 3 main
components for choosing some settings – the currency in
which the bill will be converted, the number of products
that the user wants to buy, a switch that indicates whether
the user wants home delivery and a slider for the amount
of Coca-Cola that the user wants.
1. First at the top of the View there are 3 buttons with
Titles respectively:
a. Dollar($)
b. Euro(EUR)
c. Bulgarian leva (BGN)
These buttons are used to determine the currency of the
bill. When one of these buttons is tapped, the total price
shown in the price label is converted to the selected
currency.

2. Second there are 3 labels with desired meals:


a. Soup -2 EUR
b. Main dish – 4.5 EUR
c. Desert – 1.5 EUR
d. Coke 2 EUR/ liter
For meals from a-c there is a small textfield to the right of
the labels, that can be used to set and display the quantity
of the desired meal. Also right to the textfield there should
be two buttons for every dish – a “plus” and a “minus”
button that set the quantity of a dish.
You must validate the quantity – it should be a number
between 0 and 10.
Right to the “Coke” label there should be a slider that
defines how much Coke the user wants. The possible
values are between 0 and 2 liters.

3. The last component presents the details about the bill.


There is a switch to select if the user wants a delivery to
his/her place. This service costs 10 EUR. Next to the
switch is a “Calculate” button.
There is a Total Price Label that displays the price of the
order when the Calculate button is tapped. It should be
calculated in the desired currency and if the user choses
another currency the total amount is automatically
recalculated.