-
-
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
Replaced unnecessary NSObjectProtocol #2629
Conversation
`class` is better as it allows Swift classes to avoid the NSObject overhead.
Codecov Report
@@ Coverage Diff @@
## master #2629 +/- ##
=======================================
Coverage 19.65% 19.65%
=======================================
Files 112 112
Lines 13717 13717
=======================================
Hits 2696 2696
Misses 11021 11021 Continue to review full report at Codecov.
|
Thank you. Can you provide a little more details? e.g. I don't follow swift trends sometime, if we use class, do we need to add |
Swift 4 doesn't change the rules on how things should be exposed to objective-c. Swift 4 removes most implicit The changes in this pull request do not modify any
|
Also, this doesn't impact any existing implementations of the framework. |
The only reason I mentioned |
Got it. @petester42 any comments to get this merged? Need you or @danielgindi is here reviewing such foundermental changes |
@petester42 any comments on this one? |
using The following is valid: protocol TestProtocol: class {
}
class Test: TestProtocol {
} And this is not: protocol TestProtocol: NSObjectProtocol {
}
class Test: TestProtocol {
} The code above will throw an error saying that it does not conform to NSObjectProtocol. This doesn't really matter since the protocol is marked |
While it is technically possible for any type to adopt
While it's technically possible to make alternative [to
It doesn't matter because in all cases within Charts, we don't need any methods/variables of There is one thing I left out which is that we don't really need |
What is the status of this PR? |
After rereading your comments. Seems fine to me. |
Thanks @jjatie |
class
is better as it allows Swift classes to avoid theNSObject
overhead.the @objc tag on any classes that may adopt the protocol enforces
NSObject
adoption.