Skip to content

Commit 967f3cf

Browse files
committed
Added comments
1 parent 1fdcee6 commit 967f3cf

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

ExampleMVVM/Data/PersistentStorages/CoreDataStorage/CoreDataStorage.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ final class CoreDataStorage {
2222
let container = NSPersistentContainer(name: "CoreDataStorage")
2323
container.loadPersistentStores { _, error in
2424
if let error = error as NSError? {
25-
// Log to Crashlytics
26-
debugPrint("CoreDataStorage Unresolved error \(error), \(error.userInfo)")
25+
// TODO: - Log to Crashlytics
26+
assertionFailure("CoreDataStorage Unresolved error \(error), \(error.userInfo)")
2727
}
2828
}
2929
return container
@@ -36,8 +36,8 @@ final class CoreDataStorage {
3636
do {
3737
try context.save()
3838
} catch {
39-
// Log to Crashlytics
40-
debugPrint("CoreDataStorage Unresolved error \(error), \((error as NSError).userInfo)")
39+
// TODO: - Log to Crashlytics
40+
assertionFailure("CoreDataStorage Unresolved error \(error), \((error as NSError).userInfo)")
4141
}
4242
}
4343
}

ExampleMVVM/Data/PersistentStorages/MoviesResponseStorage/CoreDataMoviesResponseStorage.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ extension CoreDataMoviesResponseStorage: MoviesResponseStorage {
6262

6363
try context.save()
6464
} catch {
65-
// Log to Crashlytics
65+
// TODO: - Log to Crashlytics
6666
debugPrint("CoreDataMoviesResponseStorage Unresolved error \(error), \((error as NSError).userInfo)")
6767
}
6868
}

ExampleMVVM/Presentation/MoviesScene/MoviesList/View/MoviesListTableView/MoviesListTableViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ extension MoviesListTableViewController {
5555

5656
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
5757
guard let cell = tableView.dequeueReusableCell(withIdentifier: MoviesListItemCell.reuseIdentifier, for: indexPath) as? MoviesListItemCell else {
58-
fatalError("Cannot dequeue reusable cell \(MoviesListItemCell.self) with reuseIdentifier: \(MoviesListItemCell.reuseIdentifier)")
58+
assertionFailure("Cannot dequeue reusable cell \(MoviesListItemCell.self) with reuseIdentifier: \(MoviesListItemCell.reuseIdentifier)")
59+
return .init()
5960
}
6061

6162
cell.fill(with: items[indexPath.row],

ExampleMVVM/Presentation/Utils/Extensions/UIViewController+AddBehaviors.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
// Created by Oleh Kudinov on 03/04/2020.
66
//
77
// View controller lifecycle behaviors https://irace.me/lifecycle-behaviors
8+
// Behaviors are very useful to reuse logic for cases like Keyboard Behaviour.
9+
// Where ViewController on didLoad adds behaviour which observes keyboard frame
10+
// and scrollView content inset changes based on keyboard frame.
811

912
import UIKit
1013

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ iOS Project implemented with Clean Layered Architecture and MVVM. (Can be used a
2323
* [Flow Coordinator](ExampleMVVM/Presentation/MoviesScene/Flows/MoviesSearchFlowCoordinator.swift)
2424
* [Data Transfer Object (DTO)](https://github.com/kudoleh/iOS-Clean-Architecture-MVVM/blob/master/ExampleMVVM/Data/Network/DataMapping/MoviesResponseDTO%2BMapping.swift)
2525
* [Response Data Caching](https://github.com/kudoleh/iOS-Clean-Architecture-MVVM/blob/master/ExampleMVVM/Data/Repositories/DefaultMoviesRepository.swift)
26+
* [ViewController Lifecycle Behavior](https://github.com/kudoleh/iOS-Clean-Architecture-MVVM/blob/1fdcee6487c5930ff7888096318159a4e6490947/ExampleMVVM/Presentation/Utils/Extensions/UIViewController%2BAddBehaviors.swift#L7)
2627
* [SwiftUI and UIKit view](ExampleMVVM/Presentation/MoviesScene/MoviesQueriesList/View/SwiftUI/MoviesQueryListView.swift) implementations by reusing same [ViewModel](ExampleMVVM/Presentation/MoviesScene/MoviesQueriesList/ViewModel/MoviesQueryListViewModel.swift) (at least Xcode 11 required)
2728
* Error handling examples: in [ViewModel](https://github.com/kudoleh/iOS-Clean-Architecture-MVVM/blob/201de7759e2d5634e3bb4b5ad524c4242c62b306/ExampleMVVM/Presentation/MoviesScene/MoviesList/ViewModel/MoviesListViewModel.swift#L116), in [Networking](https://github.com/kudoleh/iOS-Clean-Architecture-MVVM/blob/201de7759e2d5634e3bb4b5ad524c4242c62b306/ExampleMVVM/Infrastructure/Network/NetworkService.swift#L84)
2829
* CI Pipeline ([Travis CI + Fastlane](.travis.yml))

0 commit comments

Comments
 (0)