- 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.
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.
List of repositories | Infinite scroll |
---|---|
Pull to refresh | Go to repo web page |
---|---|
Back to top | Network error alert |
---|---|
Dark mode | Smaller screen |
---|---|
Larger screen |
---|
To execute the project you have to:
- Clone the repo or download the ZIP file on a Mac
- If you choose to download the ZIP file, unzip it
- Open the unziped folder
- Go to
HubStars
folder - Open
HubStars.xcworkspace
with Xcode 11 - Open terminal and run
pod install
(you must have CocoaPods installed) - Pick a simulator (choose an iPhone or iPad with iOS 13+)
- Run the project (CMD+R)
To run the tests you have to:
- Repeat the steps of Run project section
- Run tests (CMD+U)
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.