Giter Club home page Giter Club logo

aliens's Introduction

Aliens Test App

Create a small app to display the news with Reader View

Requirements

  1. Use these URLs from cointelegraph.com to display the news.
  2. Use Swift UI
  3. Allow users to touch an item of the list of news and show the news. (Show the news in App. Not open by web browsers)
  4. Allow users to enable/disable Reader View
  5. Submit with Github repo with full commits histories

Solution

WKWebView

Starting from iOS 11 WKWebView reader mode is deprecated and can't be used. There are still a few workarounds:

  1. Use third-party services as Mercury (https://mercury.postlight.com) to parse the page and emulate reader mode. Pros: easy to use. Cons: requires Mercury apikey to be embedded in the app, takes more time to render the page.
  2. Run a custom js script to parse the page and return a reader view like one. Pros: onboard solution. Cons: Depending on the script, could be unstable

The advantage of using WKWebView is UI/UX customization.

SFSafariViewController

SFSafariViewController is a native replacement of WKWebView in the case of supporting reader mode. But isn't friendly to UI/UX customization.

I have chosen this approach, as it is native, stable, and easy to use. But If SFSafariViewController custom UI/UX is a must, I recommend to do some POCs to "hack" SFSafariViewController UI.

  1. Swizzle SFSafariViewController webpage rendering
  2. Wrap SFSafariViewController in another UIViewController and control edit its frame during the presentation
  3. Overlay custom views on top SFSafariViewController

Ideas to improve

  1. Find the most stable way to replace SFSafariViewController native navigation with a custom one to improve UI/UX that would fit News App better
  2. Improve news fetching logic
  3. Add UITests

aliens's People

Contributors

alexlevnikovveryfi avatar

Watchers

James Cloos avatar Alex Levnikov avatar

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.