$29
School of Electrical Engineering and Computer Science
CptS 479 Mobile Application Development
Homework 1
General Instructions: Put the entire app directory into one zip file and submit as an attachment
under Content Homework 1 for this course on Blackboard Learn by the above deadline. Note
that you may submit multiple times, but only the most recent entry submitted before the above
deadline will be graded.
For this homework you will implement a simple app called HealthApp that displays some soothing
images to keep us healthy and happy. See screen shots below. Specifically,
1. In Xcode, create a New Project as an iOS App called HealthApp. This project should use
Interface: Storyboard, Life Cycle: UIKit App Delegate, and Language: Swift. Do not check
“Use Core Data”. Checking “Include Tests” is optional.
2. On the Storyboard, make sure “View as: iPhone 11 (wC hR)” is shown at the bottom. In
the view, add a Label at the top of the view with the app’s name “Health App”. Below that
add a Label with “Larry’s Happy Place” with your first name in place of “Larry”. These
labels should be centered horizontally and constrained to be appropriately spaced at the top
of the view.
3. Add an Image View to the view that is centered horizontally and vertically and constrained
to be of size 256x256. Make sure the Content Mode of the Image View is “Aspect Fit”.
4. Centered at the bottom of the view, add a Button called “Next”.
5. Add at least three pleasant (G-rated) images to your project. Be sure to check “Copy items
if needed” next to “Destination” if you drag-and-drop the image files into your project.
6. The basic functionality of the app is to show the images one-by-one, cycling through the
images by tapping the “Next” button. When you reach the last image, tapping “Next” will
restart the cycle at the first image. Be sure that the view is initialized with the first image
when the app starts up. You will need to create an IBOutlet to the Image View and an
IBAction for the “Next” button. See the FirstApp example in the Introduction lecture notes
for some hints on how to do this.
7. Test your app using the iPhone 11 simulator, which is the same simulator we will use to
grade your app.
8. Be sure that auto layout constraints are set so that the view elements are appropriately
displayed with no overlap or trimming regardless of device orientation.
2
Storyboard:
Simulator: