A small, read-only app for Hacker News.

Overview

Hacker News Reader

Available on the App Store

This is a simple Hacker News front-page reader that I cooked up because I didn't like any existing solutions. A lot of times apps are bloated with useless features or annoying UI, so I built something dead simple.

Why?

There were some concepts I wanted to explore, and I needed a simple Hacker News reader. Here are the key things that I took away from building this:

Text Rendering

I wanted to get dynamic text sizing working on an iPhone 4 at 60fps. And it works! It's mostly done by sizing the text on a background queue immediately after parsing the HTML. This is all done in one pass so it seems like its still hitting the network.

Composition/Architecture

I also wanted to build a small version of an app that is highly composed and modular. Even though its simple, this is still a model of an app that I would and did ship to production.

Utility Design

I despise apps that spend more time on animations and gimicks instead of the core feature. I go to Hacker News to read, not to watch my webview explode into frame with springs and struts. This app is an example of something built for the content, not just to be used.

Open Sourcing

Lastly, I learned a lot from other open source projects, so I hope that someone can get something out of this project: composition, text rendering, architecture, etc. If this app was useful at all, please let me know!

Also, if you want to add features to this, please fork or throw me a pull request. I'd like to eventually add:

  • Login and sessions
  • Commenting
  • User profiles
  • Upvoting
  • Favoriting/saving

Contact

You can find me on Twitter at @_ryannystrom.

Comments
  • Login and session

    Login and session

    Hi Ryan!

    I've finally made this. The user can now login using their credentials. The login information is stored in the shared session which persists across the app's relaunches. There's a bar item button for login/logout, a login view and network tools for the feature.

    The HNService class was modified a little bit for two reasons:

    1. It can now perform POST requests alongside GET requests.
    2. The stringByAppendingPathComponent: function used to compose a string representation of the URL doesn't work well with URLs actually. It's stated in the documentation: Note that this method only works with file paths (not, for example, string representations of URLs).. The downside of the function is that it turns "https://news.ycombinator.com" into "https:/news.ycombinator.com", and while the latter does allow the app to fetch data it doesn't use cookies stored for the former (during the login process).

    I hope the changes feel well. If anything (hopefully that won't be the whole request though) isn't consistent with the app's design I would love to modify it.

    opened by stansidel 3
  • iPhone X support

    iPhone X support

    Hey, @rnystrom

    Summary:

    • Use safe area layout guides
    • Tested only on the iPhone X simulator

    I added usage of the safe area layout guides. Next step could be migrating from the UISearchDisplayController to UISearchController and presenting search controller directly in the navigation bar?

    Closes #18.

    Now it looks like this: screen shot 2017-12-15 at 20 59 29

    Thanks!

    opened by ivan-magda 1
  • App No longer working

    App No longer working

    Hi,

    Below is what I get when I open the app. Am wondering if it has been discontinued. I have deleted it, waited for over a week and then installed it again. Same issue.

    iPhone 8+. App Version: 1.3.0

    HackerNewsApp

    Thanks

    opened by jawsino 0
  • SFSafariViewController support, 3D Touch, full iOS 11 support, and other improvements

    SFSafariViewController support, 3D Touch, full iOS 11 support, and other improvements

    Hi @rnystrom!

    I've been sitting on these changes for a while, partially because of #16, and partially because I wasn't sure you were still maintaining this. This pull request has a lot of stuff in it, so let me go over it:

    • Uses SFSafariViewController wherever HNWebViewController was used. Not much to say here since it was mostly a drop-in replacement.
    • Support of 3D Touch wherever it seems appropriate–the link in the feed, the comments button in the feed, and the link in the header in the comments view.
    • Replace an en dash that was bothering me with a minus sign (which has the same width as a plus sign).

    Also, there's a slightly controversial change of collapsing comments by tapping on them. This might not be what you want, so I'm fine with dropping it, but my rationale behind it was that there was no action performed by tapping on cells anyways so why not?

    Finally, this pull request has full iOS 11 support. In particular, it fixes a couple of legacy issues and adapts the new large titles, integrated UISearchController/UIRefreshControl, etc. Plus there's a couple of fixes for warnings and whatnot. I know there are other pull requests for a subset of the things in mine, but they're not quite there. In particular, #19 doesn't actually fix the comment layout views, which fly off the screen, #22 uses private API to turn the search bar white and keeps a separate results controller, which I think introduces complexity.

    You may notice that this pull request doesn't actually merge cleanly; this was done on purpose. I'm requesting that if you merge this, you do so as-is. The reason for this is that some recent commits have introduced some changes that aren't really necessary (especially with regards to updated Cocoapods), and I've gone through and manually picked out the useful bits. Of course, this makes the pull request seem behind your master branch, but Cocoapods should be up to date.

    opened by saagarjha 1
  • Invalid use of UIKit from a background thread

    Invalid use of UIKit from a background thread

    Main Thread Checker detected invalid usage of UIKit on a background thread:

    Classes/ViewControllers/HNCommentViewController.m:
    runtime: UI API called from background thread: -[UIView bounds] must be used from main thread only
    

    Inside of [dataCoordinator:didUpdateObject:]

    CGFloat width = CGRectGetWidth(self.view.bounds) - insets.left - insets.right;
    
    opened by ivan-magda 0
  • Replace UISearchDisplayController with UISearchController

    Replace UISearchDisplayController with UISearchController

    Hey, @rnystrom !

    Summary:

    • Migrate to UISearchController
    • Due to this issue on iOS 11.0, use the new way to show search bar

    Closes #21.

    On iOS 11.0 and later looks likes this:

    simulator screen shot - iphone se - 2018-01-08 at 15 17 27

    Thanks!

    opened by ivan-magda 0
Owner
Ryan Nystrom
Ryan Nystrom
NewsAPISwift is a Swift client for News API V2, a service that provides breaking news headlines, and search for articles from over 30,000 news sources and blogs.

NewsAPISwift NewsAPISwift is a Swift client for News API V2, a service that provides breaking news headlines, and search for articles from over 30,000

Lucas Lima 22 Feb 10, 2022
Matthew Ogtong 0 Jan 20, 2022
App that shows recently posted articles about Android or iOS on Hacker News

App that shows recently posted articles about Android or iOS on Hacker News

Jose Moffa 0 Nov 9, 2021
Hackers is an elegant iOS app for reading Hacker News written in Swift.

Hackers Hackers is an iPhone and iPad app for reading Hacker News on the go. It's optimised for quickly catching up on the latest news and comments wi

Weiran Zhang 628 Dec 26, 2022
A Hacker News reader iOS app written in Swift.

HackerNews A Hacker News reader iOS app written in Swift. Features View "top", "newest", and "show" posts from Hacker News. Read posts using the SFSaf

Amit Burstein 1.3k Dec 21, 2022
Hacker News client for macOS

HNReaderApp This is the public repository for the HNReader macOS application. You can report any issue and suggest/request new features in the issue s

Mattia Righetti 186 Oct 14, 2022
Daily News is a news app with good looking user interface ! Apps architecture is MVVM and used RxSwift for binding.

Daily News Hey ! Daily News is a news app with good looking user interface ! Apps architecture is MVVM and used RxSwift for binding. Architecture I pr

Latif Atci 39 Dec 13, 2022
News app to see daily news from new York Times

News This project is demo project for newyork time apis news feed. Generally thi

kamalesh 0 Dec 18, 2021
News - A news app that use NewsAPI

News app - UIKit This is a news app that use NewsAPI - Features MVC design patte

Muhammed Faruk Söğüt 1 Jan 4, 2022
News App for Latinx News built in UIKit programmatically

LatinxNewsApp News App for Latinx News built in UIKit programmatically Overview LatinxNewsApp is a design taken from a bigger idea. It is a news app t

Bryan Gomez 1 Apr 21, 2022
Small iOS app to show some COVID-19 health, data, news and tweets ⚡

covid19.swift Small iOS app to show some COVID-19 health, data, news and tweets ⚡ Requirements Xcode 12, iOS 14 Credits API: COVID-19 API: News Tweets

null 26 Nov 30, 2022
📰 iOS news app in the style of the NYT, WSJ, CNN, BBC, FB, Twitter, Reddit & more - Includes a tvOS app :tv:

News iOS news app in the style of Apollo, Apple News, Axios, BBC, CNN, Facebook, Facebook News, FastNews, Flipboard, Lil News, NBC News, Reddit, The N

null 119 Dec 17, 2022
Fancy news app that diwnloads data from new.com api and shows it in a paging collectionview.

Fancy news reader PAging collection view that shows latest news from techcurch.com and displays full content in a detail page, was built to practice t

Abdul-Mujeeb Aliu 31 Feb 10, 2022
News app that using the NewsAPI

Appcent-Case It's News app that using the NewsAPI. Features Search News Show News Detail Add Favorite Delete Favorite Clear Favorites Share News Show

Ercan Garip 0 Aug 10, 2022
SimpleRSSReader is a simple app showing the latest Apple news.

SimpleRSSReader SimpleRSSReader is a simple app showing the latest Apple news. It demos the usage of following stuff: How to use XML Parser Delegate t

Milenko 1 Dec 8, 2021
This is my version of the H4X0R News app, taught by Angela Yu on the iOS Development Bootcamp.

H4X0R News ?? (I didn't choose the name btw) What is it about? H4X0R News is an app that shows the front page news from Hacker News Website, and when

Victor Colen 0 Nov 2, 2021
Today. News app for iOS

Today - News app for iOS This iOS app displays a list of news, fetched from mediastack API. Running This Project Clone this project and open with XCod

Ege Alpay 0 Nov 28, 2021
Headline News View Example App for iOS. You can display the articles fetched by rss.

HeadLineNews-ObjC Headline News View Example App for iOS. You can display the articles fetched by rss. PiP(Picture in Picture) is also supported DEMO

null 11 May 31, 2022
A beautifully designed app for Apple Developer News

A beautifully designed app for Apple Developer News

Milan Manwar 17 Apr 6, 2020