我已经在我的Fb快照测试箱项目中的一个测试文件中获得了FBSnapshotTestCase库和子类。但是,如果我试图调用FBSnapshotVerifyView,就会得到一个未找到错误的方法。
发布于 2015-01-30 19:17:24
我今天也有同样的问题,我开始了一个新的项目,在迅速。另外,我用叉子修理它。你会在那里找到它:
https://github.com/delannoyk/ios-snapshot-test-case
您可以将其添加为Pod:
target "Tests" do
pod 'FBSnapshotTestCase', :git => 'https://github.com/delannoyk/ios-snapshot-test-case'
end发布于 2015-03-27 13:31:51
您可以创建一个扩展名并在桥文件中导入它:
FBSnapshotTestCase+SwiftAdditions.h:
#import <Foundation/Foundation.h>
#import <FBSnapshotTestCase/FBSnapshotTestCase.h>
@interface FBSnapshotTestCase (SwiftAdditions)
- (void) snapshotVerifyView:(UIView *)view withIdentifier:(NSString *)identifier;
- (void) snapshotVerifyLayer:(CALayer *)layer withIdentifier:(NSString *)identifier;
@endFBSnapshotTestCase+SwiftAdditions.m:
#import "FBSnapshotTestCase+SwiftAdditions.h"
@implementation FBSnapshotTestCase (SwiftAdditions)
- (void) snapshotVerifyView:(UIView *)view withIdentifier:(NSString *)identifier
{
FBSnapshotVerifyView(view, identifier);
}
- (void) snapshotVerifyLayer:(CALayer *)layer withIdentifier:(NSString *)identifier
{
FBSnapshotVerifyLayer(layer, identifier);
}
@endhttps://stackoverflow.com/questions/27021323
复制相似问题