WorldTrotter application where the user can convert temperatures from degrees Fahrenheit to celsius and also show the location of the user in a map
- The view hierarchy
- Initialize views programmatically
- The view’s frame
CGRect
CGPoint
that contains the origin of theCGRect
sCGSize
that contains the size of theCGRect
- Customize the view hierarchy from the life cycle function
viewDidLoad()
- Add subviews to views
- The view’s frame
UIWindow
as the superview of all views- Absolute frames versus Auto layout constraints
CALayer
andCAGradientLayer
- Tab Bar Controller
- Transition relationship segues between Tab Bar Controllers and view controllers.
- Tab Bar Controller as the initial view controller
- Property
view
inUIViewController
s as the root of the view controller’s view hierarchy - Introduction to Map Kit View
- Associate interfaces with view controllers classes
- Lazy loading of view controllers
- View controllers life cycle
- Set up constraints and controls programmatically.
- Explicit constraints
NSLayoutConstraint
- Fix Autoresize mask inconsistencies with the property
translatesAutoresizingMaskIntoConstraints
- Creation of constraints wirh anchors
- Layout Guides
safeAreaLayoutGuide
- Margins
layoutMarginsGuide
UISegmentedControl
- Explicit constraints
- Control events with Target-Action paradigm
- Expose methods to the Objective-C runtime with the
@objc
annotation
- Expose methods to the Objective-C runtime with the
- Refactoring
- Design patterns
- Factory Method
- Activate constraints with
NSLayoutConstraint.activate(_)
- Create an extension of
UIColor
to reuse customized colours - Use of extension files to make the extensions reusable on other projects
- Create customized labels that inherit
UILabel
- Text Editing
UITextField
- Keyboard attributes
UITextInputTraits
- Responding to text field changes
.editingChanged
- Dismissing the keyboard
UITapGestureRecognizer
- Number Formatters
NumberFormatter
- Delegate Design Pattern
- Conforming to a Protocol
- Using a delegate
- Implement
UITextFieldDelegate
- WorldTrotter application where the user can convert temperatures from degrees Fahrenheit to celsius and also show the location of the user in a map.
- The layout of the two main screens are made both with Storyboard and programmatically.
- The user navigate from one screen to another with a tab bar.
- Challenge 1: Points of Interest
- Add a
UILabel
andUISwitch
to theMapViewController
interface. - The label should say “Points of Interest” and the switch should toggle the display of points of interest on the map.
- You will want to add a **target-action** pair to the switch that updates the map’s
pointOfInterestFilter
property.
- Add a
- Challenge 2: Rebuild the Conversion Interface
- Currently, the
ConversionViewController
interface is being built in Interface Builder. - Delete the interface in the storyboard and re-create it programmatically inConversionViewController.swift.
- You will want to override
loadView()
just as you did forMapViewController
.
- Currently, the
- Challenge 3: Disallow Alphabetic Characters
- Currently, the user can enter alphabetic characters either by using a Bluetooth keyboard or by pasting copied text into the text field. Fix this issue
- Challenge 4: Displaying the User’s Region
- Display and zoom in on the user’s location on the map.
MKMapView
has a mechanism for displaying a blue dot annotation on the map, but there is no built-in way to zoom in on that location. To get this to work, you will need to do a few things: - Add a “Privacy – Location When In Use Usage Description” key to your application’s Info.plist. This key is associated with a description that tells your users why you will be accessing their location information.
- Ask the user for permission to find their location. You will need to add a property to
MapViewController
for aCLLocationManager
instance and callrequestWhenInUseAuthorization()
when theMapViewController
’s view appears. This will present an alert to the user with the usage description requesting their permission to get their location. - Use the user’s location to zoom in on their map region. To do this, assign the map’s
delegate
property. Look through the documentation forMKMapViewDelegate
and find the appropriate callback to get informed when the user’s location has been updated. - Implement this method to set the region on the map, either directly or using
setRegion(_:animated:)
.
- Display and zoom in on the user’s location on the map.
Review Pair Programming without deadline