/hub-stars

Primary LanguageSwiftMIT LicenseMIT

Cover

HubStarts project

Features description

  • Displays list of most popular GitHub Swift repositories. Fetches info from GitHub API.
  • Infinite scroll. More content is shown as the user scrolls down.
  • Pull to refresh. Scroll down on the beginning of the list to refresh its content.
  • Go to repository web page. The web page is displayed in a SFSafariViewController.
  • Back to top. After the first page is loaded, a button to go back to top of list is available.
  • Alert on network error. If any error occurs during the request, an alert message is displayed.
  • Responsive layout. The layout is adaptive to small and large devices, in landscape or portrait mode.
  • Friendly loading indicator. A skeleton view is shown when loading cells.
  • Supports dark mode.
  • Texts in english and portuguese.

Technical description

These are the patterns and frameworks used in this project.

  • MVVM-C Architecture. It separates the responsibilities and keep the code easier to unit test.
  • Views were created programmatically.
  • Binding VM-View with delegate pattern.
  • Generic class to network requests. This same class could be used to get data from other APIs over the app, if necessary.
  • Unit tests of View-Models and Models with Quick&Nimble.
  • UI tests with iOSSnapshotTestCase.
  • Use SwiftLint to keep code format.

Screenshots

List of repositories Infinite scroll
loading cells loading_more_cells
Pull to refresh Go to repo web page
pull_to_refresh sf_safari_controller
Back to top Network error alert
back_to_top errror_networks
Dark mode Smaller screen
dark_mode iphone_se
Larger screen
large_screen

How to use

Run project

To execute the project you have to:

  1. Clone the repo or download the ZIP file on a Mac
  2. If you choose to download the ZIP file, unzip it
  3. Open the unziped folder
  4. Go to HubStars folder
  5. Open HubStars.xcworkspace with Xcode 11
  6. Open terminal and run pod install (you must have CocoaPods installed)
  7. Pick a simulator (choose an iPhone or iPad with iOS 13+)
  8. Run the project (CMD+R)

Run tests

To run the tests you have to:

  1. Repeat the steps of Run project section
  2. Run tests (CMD+U)

License

MIT License

Copyright (c) 2020 Débora Moura

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.