Coder Social home page Coder Social logo

alfianlosari / newsappswiftui Goto Github PK

View Code? Open in Web Editor NEW
189.0 6.0 31.0 1.91 MB

A Full News App based on the latest SwiftUI 3 API and Swift 5.5 that fetches latest news from newsapi.org. Multiplatform support targeting iOS 15, macOS 12, watchOS 8, tvOS 15.

License: MIT License

Swift 100.00%
ipados macos tvos watchos ios swift swiftui ios15 macos12 tvos15

newsappswiftui's Introduction

SwiftUI 3.0 News App for iOS 15, iPadOS 15, macOS 12, watchOS 8, tvOS 15

Alt text

A Full News App based on the latest SwiftUI 3 that fetches latest news from newsapi.org targeting iOS 15, macOS 12, watchOS 8, and tvOS 15.

Features

The app has several main features:

  1. Fetch news based on categories: general, business, science, technology, health, entertainment, sports
  2. Bookmark articles so it can be persisted even when the app restarts.
  3. Share article using native iOS share sheet UIActivityController.
  4. Read article inside a Safari Webview in modal sheet presentation.
  5. Search news based on the search query you type on the search bar.
  6. Recent search history list.
  7. Suggestion search list.
  8. Watch Connectivity and Watch Face Complication support for watchOS.
  9. Intent Configurable Widgets - iOS, iPadOS, macOS - S, M, L, XL Family Sizes

SwiftUI 3 API:

The SwiftUI 3 APIs used to build the app:

  1. Async Await, Structured Concurrency, and Actors.
  2. Task Lifecycle View Modifer.
  3. AsyncImage.
  4. Refreshable and SwipeAction on List.
  5. Actor to isolate disk persistence.
  6. Crafting Search Experience using Swift Searchable modifier. synchronous local search and async remote search, as well as providing search suggestions.

Getting Started

  • Register for an API Key at https://newsapi.org
  • Paste the key inside NewsAPI.swift file.
  • Download Xcode 13 from App Store.

Installation

  • Build and run the project using iOS 15, iPadOS 15, watchOS 8, tvOS 15 physical devices or simulator from Xcode 13
  • For building macOS 12 target you need to use Xcode 13 Beta 5 or upcoming Xcode 13.X release and macOS 12 Beta 7.

Tutorial

This project is based on the YouTube tutorial series that you can watch from these links:

  1. Build an iOS News App with SwiftUI 3 & NewsAPI | Full Course YouTube.
  2. Add iPadOS UX Adaptivity to an iOS News App with SwiftUI 3 | Full Course YouTube.
  3. Build a macOS News App with SwiftUI 3 & NewsAPI | Full Course YouTube.
  4. Build a watchOS News App with SwiftUI 3 & NewsAPI | Full Course YouTube.
  5. Build a tvOS News App with SwiftUI 3 & NewsAPI | Full Course YouTube.
  6. Data Caching with SwiftUI Task YouTube.
  7. Adding Infinity Scroll Pagination in SwiftUI with Task Modifier YouTube.
  8. 8 Add Widget to Home Screen YouTube.

newsappswiftui's People

Contributors

alfianlosari avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

newsappswiftui's Issues

NewsTabView fires refreshTask on every viewWillAppear

If you changed the way the app shows the details for news items by navigating to the details view using the NavigationView (instead of presenting Safari sheet), and then return back to the news list, the list gets refreshed which is not the right behavior. I think there should be come control on this point using the FetchTaskToken struct

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.