lolgear
(Dmitry Lobanov)
1
I know that it is possible to set __deprecated attribute to category.
Is it possible to exclude whole category of Objective-C class by, for example, exclude attribute?
jrose
(Jordan Rose)
2
__attribute__((unavailable)) (or UNAVAILABLE_ATTRIBUTE in Apple headers) might do what you want. There's also NS_SWIFT_UNAVAILABLE if you just want to mark things unavailable from Swift.
lolgear
(Dmitry Lobanov)
3
Did you try it?
I mark category interface in header as unavailable and still have category symbols in Swift.
michelf
(Michel Fortin)
4
Another option...
#if DEPLOYMENT_RUNTIME_SWIFT
// Swift should see nothing.
#else
@interface MyObject (CategoryName)
- (void)someCategoryMethod;
@end
#endif
1 Like