This tutorial will guide you through creating a Food Tracker app, it is based on the Apple Guide for developing iOS apps, I found the guide great to work with, but unfortunately it wasn't up to date with all the latest changes that have been made in Swift v3.1
Each section will build upon the previous one and eventually help you build an app that lets you view/edit/delete food that you may have eaten.
Content
Basic UI
Before we start you'll need to
- create a new Xcode project(name it whatever you wish, FoodTracker might be a good)
- It needs to be an iOS Single View application
- look through the files that Xcode has created for you to get yourself ready to dive in(especially ViewController.swift, Main.storyboard)
- open Main.storyboard
- Add an input field (found in the Object Library)
- Align the left and right edges of the text field until you see three vertical layout guides
- In the Attributes inspector add a placeholder for the input `Enter meal name`
- Also change the Return Key dropdown from `default` to `Done`
- Also select the Auto-enabled Return Key checkbox
- Add a Label to the storyboard
- Align it so that it is in line with the left side and above the text field
- Edit the name of the label by double clicking it and changing it to `Meal Name`
- Add a Button to the storyboard
- Align it so that it is in line with the left side and below the text field
- Edit the name of the button by double clicking it and changing it to `Set Default Label Text`
Why:question: We want the design to be universal so that it works across all iOS devices from iPhone 5 to iPad Pro and this is one way to go about solving this issue.
- Select all items on the storyboard by pressing the shift key and selecting the text field, label and button.
- Stack the items together (groups them together either vertically or horizontally, Xcode is clever and will do this automatically)
- Apply constraints to the left(0) and right(0) to the input field so that it stretches out (make sure that the input field has been selected)

- Also change the Intrinsic Size from
DefaulttoPlaceholderin the Size Inspector
If you've come across any issues and are unable to get your code up and running then here is the link to the XCode project for this Tutorial.




