2

right now I am developing a project using swift and I use some of class in objective c. I have set up bridge and most of them work fine. But I have a problem to override the method defined in objective class.

#import <UIKit/UIKit.h>
#import "ASFTableViewPublicGlobals.h"

@class ASFTableView;

@protocol ASFTableViewDelegate <NSObject>

@optional

- (void)ASFTableView:(ASFTableView *)tableView DidScroll:(UIScrollView     *)aScrollView;

@end



@interface ASFTableView : UIView

@property (nonatomic, assign) id<ASFTableViewDelegate> delegate;

- (void)ASFTableView:(ASFTableView *)tableView DidSelectRow:(NSDictionary *)rowDict WithRowIndex:(NSUInteger)rowIndex;

@end

As you see, the class in objective c is defined ASFTableView, and after I set up the bridge and everything, I define a class in swift

import UIkit

class asftable: ASFTableView {

}

This work without any error, but when I want to override the method

import UIkit

class asftable: ASFTableView {

override func ASFTableView(tableView: ASFTableView!, didSelectRow rowDict: [NSObject : AnyObject]!, withRowIndex rowIndex: UInt) {

} 

}

xcode will show up a use of undeclared type ASFTableView, I have try cmd+click on ASFTableView, it shows symbol not found. without override this method, I could jump to the code of ASFTableView.

Anyone see the solution of this situation?

4

0 回答 0