Bugfix: Fix force unwraps that lead to crashes#88
Open
btxsqdr wants to merge 3 commits intozjfjack:masterfrom
Open
Bugfix: Fix force unwraps that lead to crashes#88btxsqdr wants to merge 3 commits intozjfjack:masterfrom
btxsqdr wants to merge 3 commits intozjfjack:masterfrom
Conversation
added 2 commits
July 18, 2019 11:01
zjfjack
reviewed
Jul 26, 2019
| // JZCalendarWeekView | ||
| // | ||
| // Created by Jeff Zhang on 26/4/18. | ||
| // Copyright © 2018 Jeff Zhang. All rights reserved. |
Owner
There was a problem hiding this comment.
I don't think this is necessary.
Author
There was a problem hiding this comment.
it was the xcode formatter, apparently. sure, let me remove it.
Owner
|
Hi, Can you remove all the indents change from SwiftLint in this pull request? I think it is really confused in this pull request. If it is necessary, I will apply SwiftLint in another day and remove all the indents in this project in one commit. Thanks again |
Owner
|
Hi, In order to improve this project, I applied Swiftlint and update to Swift 5. Could you rebase the master branch and push again? Thanks |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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