如何从swift类调用以下目标c类别

时间:2016-06-18 03:52:52

标签: ios objective-c swift

#import <UIKit/UIKit.h>

@interface UIView (AEScaningEffect)


- (void) startScaningRepeatCount:(int)count;
- (void) startScaningRepeatCount:(int)count Duration:(int)duration;
- (void) startScaningRepeatCount:(int)count Duration:(int)duration HeightFactor:(float) factor;

- (void) stopScaning;

@end

2 个答案:

答案 0 :(得分:3)

您可以简单地将其称为:

imgView.startScaningRepeatCount(2)

或者

imgView.startScaningRepeatCount(1000, duration: 2)

或者

imgView.startScaningRepeatCount(1000, duration: 2, heightFactor: 0.3)

请务必从项目的桥接标题中导入您的类别标题。

答案 1 :(得分:2)

您可以这样称呼它:

var view = UIView(frame: CGRect.zero)

view.startScaningRepeatCount(0)
view.startScaningRepeatCount(0, duration: 0)
view.startScaningRepeatCount(0, duration: 0, heightFactor: 0)
view.stopScaning()