Skip to content

Headlines, an iOS app developed in Swift, serves as a dynamic news hub, keeping users informed with curated top stories and allowing personalization of news feeds. It enables seamless sharing of articles and offers saving favorite pieces to a personal library.

Notifications You must be signed in to change notification settings

nicktheodoridisiOS/Headlines

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Headlines Mobile Application

cover

About Application

Headlines, an iOS app developed in Swift, serves as a dynamic news hub, keeping users informed with curated top stories and allowing personalization of news feeds. It enables seamless sharing of articles and offers saving favorite pieces to a personal library.

User Preferences

preferences

Dark Mode Display

display

Persist Data and Data Synchronization

preferences

For persistent data and data synchronization, the SwiftData framework was used. This way, the user can store their data by synchronizing it across multiple devices with the same account credentials.

@Model
public class Article {
    @Attribute(.unique) public var id: UUID = UUID()
    var uri: String
    var section: String
    var title: String
    var abstract: String
    var author: String
    var publishedDate: String
    var imageURL: String
    var link: String
    
    init(uri: String, section: String, title: String, abstract: String, author: String, publishedDate: String, imageURL: String, link: String) {
        self.uri = uri
        self.section = section
        self.title = title
        self.abstract = abstract
        self.author = author
        self.publishedDate = publishedDate
        self.imageURL = imageURL
        self.link = link
    }
}

API Reference

For the implementation of Headlines application, I utilized TheNewYorkTimes API which provides endpoints for searching articles, retrieving top stories and more.

Top Stories Endpoint Call Example

Parameter Type Value Description
api_key string myApiKey Required
section string world Required
  GET https://api.nytimes.com/svc/topstories/v2/world.json?api-key=myApiKey

This will return (with JSON format) the top stories from the selected category from the articles of The New York Times:

{
    "status": "OK",
    "copyright": "Copyright (c) 2024 The New York Times Company. All Rights Reserved.",
    "section": "World News",
    "last_updated": "2024-05-13T09:59:16-04:00",
    "num_results": 37,
    "results": [
        {
            "section": "",
            "subsection": "",
            "title": "Middle East Crisis: Anger and Protests Shadow Israel’s Memorial Day",
            "abstract": "Hecklers assailed Prime Minister Benjamin Netanyahu and other leaders as tensions over the Oct. 7 attacks and the Gaza war flared on one of Israel’s most solemn holidays.",
            "url": "https://www.nytimes.com/live/2024/05/13/world/israel-gaza-war-hamas-rafah",
            "uri": "nyt://promo/99de9cc4-4e4d-59ac-85e1-227bd85e55a2",
            "byline": "",
            "item_type": "Promo",
            "updated_date": "2024-05-13T13:29:00-04:00",
            "created_date": "2024-05-13T05:55:34-04:00",
            "published_date": "2024-05-13T05:55:34-04:00",
            "material_type_facet": "",
            "kicker": "",
            "des_facet": [],
            "org_facet": [],
            "per_facet": [],
            "geo_facet": [],
            "multimedia": [
                {
                    "url": "https://static01.nyt.com/images/2024/05/13/multimedia/13mideast-crisis-promo-130pm-cvfb/13mideast-crisis-promo-130pm-cvfb-superJumbo.jpg",
                    "format": "Super Jumbo",
                    "height": 1365,
                    "width": 2048,
                    "type": "image",
                    "subtype": "photo",
                    "caption": "",
                    "copyright": "Leo Correa/Associated Press"
                },
                {
                    "url": "https://static01.nyt.com/images/2024/05/13/multimedia/13mideast-crisis-promo-130pm-cvfb/13mideast-crisis-promo-130pm-cvfb-threeByTwoSmallAt2X.jpg",
                    "format": "threeByTwoSmallAt2X",
                    "height": 400,
                    "width": 600,
                    "type": "image",
                    "subtype": "photo",
                    "caption": "",
                    "copyright": "Leo Correa/Associated Press"
                },
                {
                    "url": "https://static01.nyt.com/images/2024/05/13/multimedia/13mideast-crisis-promo-130pm-cvfb/13mideast-crisis-promo-130pm-cvfb-thumbLarge.jpg",
                    "format": "Large Thumbnail",
                    "height": 150,
                    "width": 150,
                    "type": "image",
                    "subtype": "photo",
                    "caption": "",
                    "copyright": "Leo Correa/Associated Press"
                }
            ],
            "short_url": ""
        }
      ]
}

Project Tools

Xcode GitHub Figma Postman
mode mode mode mode

Programming Stack

Swift SwiftUI SwiftData
mode mode mode

Note

The reason this particular project doesn't have source code is because I want it to remain private. However, I still want to present my work through this README file. For any questions or inquiries, feel free to contact me. You can find contact details below.

Contact

I'm always open to questions, suggestions and comments. If you have any questions or need assistance, feel free to contact me at nicktheodoridiscontact@gmail.com or through my GitHub account.

Socials

Follow me on social media for the latest news and updates:

License

This project is distributed under the Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0).

This means you can use, modify and share this work under the following conditions:

  • You must attribute the original creator (attribution).
  • You may not use this work for commercial purposes (non-commercial use).

About

Headlines, an iOS app developed in Swift, serves as a dynamic news hub, keeping users informed with curated top stories and allowing personalization of news feeds. It enables seamless sharing of articles and offers saving favorite pieces to a personal library.

Topics

Resources

Stars

Watchers

Forks

Languages