This entire question premise might be completely ridden with issues due to the fact that I am updating a project written in Objective-C with Swift.
First off, I am trying to access methods belonging to a class written in Objective-C from a Swift subclass that has inherited it. However there are some methods that I can see and access but others are invisible (act as if they do not exist).
The .h
file for the Objective-C class is as follows:
#import <UIKit/UIKit.h>
@interface BaseMenuViewController : UIViewController
-(void)applyColourForeground:(UIColor *)foreground background:(UIColor *)background;
-(void)colorButton:(UIButton *)button foreground:(UIColor *)foreground background:(UIColor *)background;
- (void)spreadElementsVertical:(UIView *)firstArg, ...;
- (void)spreadElementsVerticalWithSeparation:(CGFloat)separation elements:(UIView *)firstArg, ...;
@end
The Swift class looks like this:
import UIKit
class FontViewController: BaseMenuViewController {
var BackButton: UIButton
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
}
}
The first two methods applyColourForeground
and colorButton
are both visible and callable from my Swift subclass but the other two spreadElementsVertical
and spreadElementsVerticalWithSeparation
are not. I am attempting to access them via super.<function>
and BaseMenuViewController.<function>
where <function>
is the name of each method but the IDE only shows the aforementioned two.
What am I missing?
Any help is appreciated.