Bugfix: Fix force unwraps that lead to crashes #88
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey @zjfjack
It can happen that the framework crashes due to too many forceReloads at the same time (2-3x per second), which should not occur, of course, but the framework should also not crash.
Crash root cause are unnecessary force_unwraps. I've tried to remove those, without changing the logic much and causing new issues. The framework is more stable now.
Hint: Technically, there is no reason to use force_unwrap in Swift, except for @IBOutlet or when .dequeueReusableCell() is in use (though it can be avoided for cells). See SwiftLint and coding guidelines by Google, for instance, see https://google.github.io/swift/#force-unwrapping-and-force-casts and also the point about https://google.github.io/swift/#implicitly-unwrapped-optionals