/
githubmr
/
facebook-react-native
Обзор
Документация
Войти
/
githubmr
/
facebook-react-native
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-native/ReactCommon/react/test_utils/ios/RCTSwizzleHelpers.m
17 строк
550 B
Phillip Pan
introduce RCTTestUtils (#37810)
12 июн 2023, 23:37
12 июн 2023, 23:37
a300a35
Код
Авторство
О чём код?
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #import "RCTSwizzleHelpers.h" #import <objc/runtime.h> void RCTSwizzleInstanceSelector(Class targetClass, Class swizzleClass, SEL selector) { Method originalMethod = class_getInstanceMethod(targetClass, selector); Method swizzleMethod = class_getInstanceMethod(swizzleClass, selector); method_exchangeImplementations(originalMethod, swizzleMethod); }