This is Github user search demo app that made with MVVM design pattern.
Search Github user and show user result list
- SearchViewModel
- SearchViewDataSource <- Adapt UITableViewDataSource and UITableViewDelegate
Show local on memory favorite repositories
- FavoriteViewModel
- FavoriteViewDataSource <- Adapt UITableViewDataSource and UITableViewDelegate
Show Github user's repositories
- UserRepositoryViewModel
- UserRepositoryViewDataSource <- Adapt UITableViewDataSource and UITableViewDelegate
Show a repository and add / remove local on memory favorites
You can add / remove favorite repositories in RepositoryViewController, but an Array of favorite repository is hold by FavoriteViewController.
To run this example, you need make install
.
In addition, you need to set Github Personal Access Token
like this.
extension ApiSession {
static let shared: ApiSession = {
let token = "" // <- Your Github Personal Access Token
return ApiSession(injectToken: { InjectableToken(token: token) })
}()
}
- Xcode 10.1 or later
- iOS 11 or later
- Swift 4.2 or later
marty-suzuki, s1180183@gmail.com
iOSDesignPatternSamples is available under the MIT license. See the LICENSE file for more info.