Hacker News in Workflow is a Hacker News client app that uses Square's Workflow to drive its business logic and Square's Blueprint and Listable for composable and declarative UI components.
Setting up and running the app should be fairly straight forward. The Hacker News API is read only and public so there is no need to setup authentication etc.
- Clone the repository,
pod install
- Build and run
This app is intended to be an example that brings Workflow, Blueprint, and Listable under one roof in an isolated, non-trivial app. It's also a good example that demonstrates:
- Nested workflows
- Embedding in a navigation controller
- Making network calls
- Firing up multiple async Workers
- Outputting actions from a child workflow to its parent
- Nontrivial state management
- Building out Worker specific actions
- Displaying different screens based on a Workflow's state
- Dependency injection within Workflow and mocking data for testing
- Testing Workflow actions
- Testing Workflow render passes under various states
- Building Workflow screens with Blueprint elements
- A reusable AttributedTextView component
- Composition of components
- Quite a few examples of components with various data and interaction funnels
- Feeding large async data that updates in multiple runs (example can be found in comments and their nested comments)
- Ability to 'load more' as user scroll to the bottom Use of refresh controller - Building out Listable rows from Blueprint components
If you're interested to expand on this example here are some ideas:
- Communicate errors back with the user.
- Add snapshot tests for UI components
- Add tests for HackerNewsRootWorkflowTests
- Show a loading indicator while nested comments are loading.
- Hacker News has different types of news articles: "Story, ask, job, poll" build article-specific row cells.
- Add refresh for comments.
- Add the ability to fold nested comments.
- Query the article's URL and see if it's possible to get a description, hero image or summary through its data attributes.