-
Notifications
You must be signed in to change notification settings - Fork 0
/
XCTestCase+Swizzle.h
35 lines (25 loc) · 1.01 KB
/
XCTestCase+Swizzle.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
// XCTestCase+Swizzle.h
// PoC
//
// Created by Ben Fowler on 19/5/15.
// Copyright (c) 2015 Maaii. All rights reserved.
//
@import XCTest;
@import ObjectiveC;
@interface SwizzleInformation : NSObject
@property (assign, nonatomic) SEL originalSelector;
@property (assign, nonatomic) SEL replacementSelector;
@property (assign, nonatomic) Method originalMethod;
@property (assign, nonatomic) Method replacementMethod;
@property (weak, nonatomic) Class class;
- (instancetype)initWithOriginalSelector:(SEL) originalSelector
replacementSelector:(SEL) replacementSelector
originalMethod:(Method) originalMethod
replacementMethod:(Method) replacementMethod
class:(Class) class;
@end
@interface XCTestCase (Swizzle)
+ (SwizzleInformation*)swizzleSelector:(SEL)originalSelector with:(SEL)replacementSelector forClass:(Class)class;
+ (void)swizzleImplementation:(SwizzleInformation*)swizzleInformation;
@end