1 |
efrain |
1 |
/*
|
|
|
2 |
* Copyright 2018 Google LLC
|
|
|
3 |
*
|
|
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
5 |
* you may not use this file except in compliance with the License.
|
|
|
6 |
* You may obtain a copy of the License at
|
|
|
7 |
*
|
|
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
9 |
*
|
|
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
|
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
13 |
* See the License for the specific language governing permissions and
|
|
|
14 |
* limitations under the License.
|
|
|
15 |
*/
|
|
|
16 |
|
|
|
17 |
#import <Foundation/Foundation.h>
|
|
|
18 |
#import "GoogleUtilities/AppDelegateSwizzler/Public/GoogleUtilities/GULAppDelegateSwizzler.h"
|
|
|
19 |
#import "GoogleUtilities/Network/Public/GoogleUtilities/GULMutableDictionary.h"
|
|
|
20 |
|
|
|
21 |
@class GULApplication;
|
|
|
22 |
|
|
|
23 |
NS_ASSUME_NONNULL_BEGIN
|
|
|
24 |
|
|
|
25 |
@interface GULAppDelegateSwizzler ()
|
|
|
26 |
|
|
|
27 |
/** ISA Swizzles the given appDelegate as the original app delegate would be.
|
|
|
28 |
*
|
|
|
29 |
* @param appDelegate The object that needs to be isa swizzled. This should conform to the
|
|
|
30 |
* application delegate protocol.
|
|
|
31 |
*/
|
|
|
32 |
+ (void)proxyAppDelegate:(id<GULApplicationDelegate>)appDelegate;
|
|
|
33 |
|
|
|
34 |
/** Returns a dictionary containing interceptor IDs mapped to a GULZeroingWeakContainer.
|
|
|
35 |
*
|
|
|
36 |
* @return A dictionary of the form {NSString : GULZeroingWeakContainer}, where the NSString is
|
|
|
37 |
* the interceptorID.
|
|
|
38 |
*/
|
|
|
39 |
+ (GULMutableDictionary *)interceptors;
|
|
|
40 |
|
|
|
41 |
/** Deletes all the registered interceptors. */
|
|
|
42 |
+ (void)clearInterceptors;
|
|
|
43 |
|
|
|
44 |
/** Resets the token that prevents the app delegate proxy from being isa swizzled multiple times. */
|
|
|
45 |
+ (void)resetProxyOriginalDelegateOnceToken;
|
|
|
46 |
|
|
|
47 |
/** Returns the original app delegate that was proxied.
|
|
|
48 |
*
|
|
|
49 |
* @return The original app delegate instance that was proxied.
|
|
|
50 |
*/
|
|
|
51 |
+ (id<GULApplicationDelegate>)originalDelegate;
|
|
|
52 |
|
|
|
53 |
@end
|
|
|
54 |
|
|
|
55 |
NS_ASSUME_NONNULL_END
|