/SW-Lab-U02Review_WReview-WorldTrotter-Prod

WorldTrotter application where the user can convert temperatures from degrees Fahrenheit to celsius and also show the location of the user in a map

Primary LanguageSwift

SW-Lab-U02Review_WReview-WorldTrotter-Prod

WorldTrotter application where the user can convert temperatures from degrees Fahrenheit to celsius and also show the location of the user in a map

Topics

  1. The view hierarchy
  2. Initialize views programmatically
    • The view’s frame CGRect
    • CGPoint that contains the origin of the CGRects
    • CGSize that contains the size of the CGRect
    • Customize the view hierarchy from the life cycle function viewDidLoad()
    • Add subviews to views
  3. UIWindow as the superview of all views
  4. Absolute frames versus Auto layout constraints
  5. CALayer and CAGradientLayer

  1. Tab Bar Controller
    • Transition relationship segues between Tab Bar Controllers and view controllers.
    • Tab Bar Controller as the initial view controller

  1. Property view in UIViewControllers as the root of the view controller’s view hierarchy
  2. Introduction to Map Kit View
  3. Associate interfaces with view controllers classes
  4. Lazy loading of view controllers
    • View controllers life cycle

  1. 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
  2. Control events with Target-Action paradigm
    • Expose methods to the Objective-C runtime with the @objc annotation
  3. 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

  1. Text Editing
    • UITextField
  2. Keyboard attributes
    • UITextInputTraits
  3. Responding to text field changes
    • .editingChanged
  4. Dismissing the keyboard
    • UITapGestureRecognizer
  5. Number Formatters
    • NumberFormatter
  6. Delegate Design Pattern
    • Conforming to a Protocol
    • Using a delegate
    • Implement UITextFieldDelegate

Description

  1. 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.
  2. Challenge 1: Points of Interest
    • Add a UILabel and UISwitch to the MapViewController 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.
  3. 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 for MapViewController.
  4. 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
  5. 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 a CLLocationManager instance and call requestWhenInUseAuthorization() when the MapViewController’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 for MKMapViewDelegate 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:).

Deadline

Review Pair Programming without deadline