Session 5

What's in the News?

Session Materials

Resources

Final Project Proposal

Write a 1-2 paragraph description of the app you plan to build. Explain the app’s purpose and functionality. Give a high-level overview of how you plan to implement it. If you’re planning to use any third-party frameworks, be sure to list them.

Along with your proposal, please include drawings or diagrams of the layout of your app. Sketch out the major screens you plan to build and show how a user would navigate between them.

Please submit your proposal as a PDF in your repo for this assignment. If you plan to work with a partner, indicate this on your proposal. The same proposal should be submitted to both students’ repos.

Assignment

Assignment repo link right here

In this assignment, you will create a search-based news reader using News API. The application will use UISplitViewController, UIStackView, URLSession, and trait variations. This will be a universal app, meaning that it supports both iPhone and iPad. It will also support both portrait and landscape orientation.

We will grade your application on multiple simulators and in both orientations. You will need to add auto-layout constraints to your views so that they display correctly in all situations.

Project Setup

Storyboard layout. You will need to add the segue that is selected in this screenshot.
Storyboard layout. You will need to add the segue that is selected in this screenshot.

Master View Controller

Fetching Data

https://newsapi.org/v2/everything?q={searchTerm}
var urlRequest = URLRequest(url: url)
urlRequest.addValue("some-api-key", forHTTPHeaderField: "X-Api-Key")

Displaying Cells

Master view controller (left) and detail view controller (right) on iPad.
Master view controller (left) and detail view controller (right) on iPad.

DetailViewController

Loading the Article

Tip: Select your web view in storyboard and check the 'Inline Playback' checkbox in the Attributes Inspector to prevent videos from automatically playing in full-screen when you load an article.



Displaying the Article’s Source

Detail View Controller on iPhone 8.
Detail View Controller on iPhone 8.

Error Handling

Master View Controller

Detail View Controller

Error loading web view on iPhone 8 Plus in portrait.
Error loading web view on iPhone 8 Plus in portrait.

Extra Credit

App Icon

Grading

We will add your grade to your repository in a branch named “Grade.”