You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Swift has no official way to mark an API as Obj-C–only such that it cannot be called from Swift. An idiom adopted by my team is to mark the API as obsoleted since Swift 1.0, thus preventing it from being called from Swift, but still allowing it to be called from Obj-C. The problem is an API marked obsoleted in this fashion cannot call another API marked obsoleted, which is rather restrictive. Here's an example:
import Foundation
classFoo:NSObject{@available(swift, obsoleted: 1.0)@objcfunc apiOnlyForObjC()->ClassOnlyForObjC{returnClassOnlyForObjC()}@objc(FooResult)@available(swift, obsoleted: 1.0)classClassOnlyForObjC:NSObject{}}
Another example would be when I'm providing several variants of an @objc method with different numbers of parameters to simulate optional parameters, I can't have the simpler versions call the more complex versions because they're all marked as obsoleted.
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: bfed417201945d33aeddb362f1d84669
Issue Description:
Swift has no official way to mark an API as Obj-C–only such that it cannot be called from Swift. An idiom adopted by my team is to mark the API as obsoleted since Swift 1.0, thus preventing it from being called from Swift, but still allowing it to be called from Obj-C. The problem is an API marked obsoleted in this fashion cannot call another API marked obsoleted, which is rather restrictive. Here's an example:
Another example would be when I'm providing several variants of an
@objc
method with different numbers of parameters to simulate optional parameters, I can't have the simpler versions call the more complex versions because they're all marked as obsoleted.The text was updated successfully, but these errors were encountered: