Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/swiftggteam/falcon
SwiftGG iOS Application
https://github.com/swiftggteam/falcon
Last synced: about 23 hours ago
JSON representation
SwiftGG iOS Application
- Host: GitHub
- URL: https://github.com/swiftggteam/falcon
- Owner: SwiftGGTeam
- Created: 2019-06-25T02:00:01.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-07-22T03:28:28.000Z (over 2 years ago)
- Last Synced: 2024-03-26T02:35:05.929Z (9 months ago)
- Language: Swift
- Homepage:
- Size: 816 KB
- Stars: 15
- Watchers: 9
- Forks: 4
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Falcon
Falcon heavy rocketπ. An iOS application for SwiftGG.
## Introduction
The Falcon is written by Swift language, and follows the MVVM architecture.
### `FalcView` & `FalcTableViewCell` & `FalcViewController`
To descripe a View in application. It needs to bind a `ViewModel` to show the datas.
```swift
class HomeItemTableViewCell: FalcTableViewCell {
override func initialViews() {}
override func updateViews() {}
override func initialLayouts() {}
override func updateLayouts() {}
}
```If we make the `cell.viewModel = xxx`, the `View` will call `updateViews` and `updateLayouts` to refresh the `View`.
### `ViewModel`
We are able to need a View Model to create a view or cell, so the `ViewModel` class can help you. It includes a group of datas to descripe all datas for a `View` or `Controller`. And the `View` can only bind the `ViewModel`.
```swift
class HomeItemTableViewCellModel: FalcViewModel {}
```In the demo, the `Article` is to descripe a basic meta model.
### `UITableView` specification
Because of holding a group of ViewModels, the ViewController can call all datas for ViewController's View. If we make a all _CellMLodels_ in the controller's ViewModel, the delegate function in `UITableView` is able to be code below:
```swift
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let vm = viewModel?.datas[safe: indexPath.row]
if let vm = vm as? HomeItemTableViewCellModel {
let cell = tableView.dequeueReusableCell(withClass: HomeItemTableViewCell.self)
cell.selectionStyle = .none
cell.viewModel = vm // update the datas and call updateViews
return cell
}
else if let vm = vm as? XXXXCellModel {
....
}
return UITableViewCell()
}
```## Deploy The Development Environment
```bash
$ git clone [email protected]:SwiftGGTeam/Falcon.git && cd Falcon
$ bundle install
$ cd Falcon
$ bundle exec pod install --repo-update
```## UI
πΌ [zeplin](https://zpl.io/aNmPNrD)
## Product Docs
π [Product Design](https://docs.google.com/document/d/1Y23SVmnmJXFGIoFXcHexPHXg_r4jENkET60bpcAwo20/edit?usp=sharing)
## License