This code works in Playground, but I get a compile error when I define this in my project in Xcode 7.2
Here is my Playground screenshot https://goo.gl/yJ4Q75
Error is: method does not override any method in the super class
public class A {
private func myUnavailableMethod() {
print("A. private func myUnavailableMethod()")
}
}
public class B : A {
override func myUnavailableMethod() {
print("B. func myUnavailableMethod()")
}
}
Motivation to this Playground was an error when trying to override a method, compiler was complaining as "Not available"
class MySFSafariViewController: SFSafariViewController {
override init() {
}
}
---- FOUND HOW THEY MARKED a method as unavailable.
When jumping to the Objective C declaration.
@interface SFSafariViewController : UIViewController
/*! @abstract The view controller's delegate */
@property (nonatomic, weak, nullable) id<SFSafariViewControllerDelegate> delegate;
****- (instancetype)init NS_UNAVAILABLE;****