-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix warnings on current code base #4321
Conversation
Fix unused instants Remove a duplicated function NSUIMainScreen()
@@ -39,11 +39,6 @@ extension UIScreen | |||
} | |||
} | |||
|
|||
func NSUIMainScreen() -> NSUIScreen? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jjatie I found this func is duplicated during half pie chart review. They are repeated under two macros iOS & macOS; I manually tested on my iOS simulator and macOS, it seems we only need one outside these macros. We are safe to delete one right? I don't come up a case that we need to put them into two places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, we don't need both. Really this should be an extension on NSUIScreen
extension NSUIScreen {
var nsuiMain: Self? { .main }
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jjatie I have pushed a new commit. but mine is
class var nsuiMain: NSUIScreen? { .main }
is there any reason to use Self?
here? Because if I use Self?
, Xcode would complain
Type 'Self?' has no member 'main'
and I have to use something like
class var nsuiMain: Self? { NSUIScreen.main as? Self }
(I can't even use { .main as? Self }
) So I think use NSUIScreen explicitly makes it cleaner.
Codecov Report
@@ Coverage Diff @@
## master #4321 +/- ##
==========================================
- Coverage 40.92% 40.91% -0.02%
==========================================
Files 124 124
Lines 9456 9454 -2
==========================================
- Hits 3870 3868 -2
Misses 5586 5586
Continue to review full report at Codecov.
|
@liuxuan30 would be good to have this merged in and released so we can eliminate XCode 11.4 warnings. 👍 |
Champion! Thank you @liuxuan30 |
* Fix warnings for vars; Fix unused instants Remove a duplicated function NSUIMainScreen() * use extension to replace NSUIMainScreen()
* Fix warnings for vars; Fix unused instants Remove a duplicated function NSUIMainScreen() * use extension to replace NSUIMainScreen()
* Fix warnings for vars; Fix unused instants Remove a duplicated function NSUIMainScreen() * use extension to replace NSUIMainScreen()
Fix warnings for vars;
Fix unused instants;
Remove a duplicated function NSUIMainScreen()