This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import XCTest | |
| import Combine | |
| import RealmSwift | |
| class RealmMultiThreadingStaleDataTests: XCTestCase { | |
| private var cancellables: Set<AnyCancellable>! | |
| override func setUpWithError() throws { | |
| super.setUp() | |
| cancellables = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| struct CollectionItemModel { | |
| let title: String? | |
| let image: UIImage? | |
| } | |
| /// First set `model` and then present on screen. | |
| final class MyCollectionViewController: UICollectionViewController { | |
| var models: [CollectionItemModel]? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| struct CollectionItemModel { | |
| let title: String? | |
| let image: UIImage? | |
| } | |
| struct CellController { | |
| var model: CollectionItemModel | |
| func getCell(collectionView: UICollectionView, indexPath: IndexPath) -> UICollectionViewCell { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| protocol CellController { | |
| func getCell(collectionView: UICollectionView, indexPath: IndexPath) -> UICollectionViewCell | |
| } | |
| struct TextItemModel { | |
| let title: String | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Presenter | |
| typealias SomeViewModel = String // this is just a placeholder for your view model type | |
| protocol SomeView { | |
| func showSomething(viewModel: SomeViewModel) | |
| } | |
| protocol SomeViewOutput { | |
| func onUserAction() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| enum LoadableContentState<LoadedContentType, ErrorContentType> { | |
| case loading | |
| case loaded(content: LoadedContentType) | |
| case error(content: ErrorContentType) | |
| } | |
| // error content for the transactions list screen | |
| struct TransactionsListLoadingErrorContent { | |
| let title: String | |
| let subtitle: String |
OlderNewer