Tag

Method Swizzling

0 views collected around this technical thread.

Sohu Tech Products
Sohu Tech Products
Nov 10, 2021 · Mobile Development

Implementing Event Tracking (埋点) in iOS Clients: Concepts, Approaches, and Code Samples

This article explains the fundamentals of event tracking in iOS apps, compares server‑side and client‑side tracking, details three implementation strategies (code‑based, non‑intrusive, and visual), introduces a data classification scheme, and provides Swift code examples—including enums, protocols, a chain‑based data‑passing mechanism, and runtime method‑hooking techniques—while also discussing practical challenges and best‑practice recommendations.

Method SwizzlingSwiftdata-passing
0 likes · 22 min read
Implementing Event Tracking (埋点) in iOS Clients: Concepts, Approaches, and Code Samples
ByteDance Dali Intelligent Technology Team
ByteDance Dali Intelligent Technology Team
Jun 19, 2021 · Mobile Development

Hooking iOS UICollectionView Delegate with Method Swizzling and NSProxy: Challenges and Solutions

This article explains how to use AOP techniques such as Method Swizzle and NSProxy to hook UICollectionView and UIViewController delegate methods for precise event tracking, analyzes compatibility problems caused by multiple delegate proxies in large apps, and proposes three practical solutions to avoid crashes and maintain extensibility.

Delegate ProxyHookingMethod Swizzling
0 likes · 15 min read
Hooking iOS UICollectionView Delegate with Method Swizzling and NSProxy: Challenges and Solutions
ByteDance Terminal Technology
ByteDance Terminal Technology
May 28, 2021 · Mobile Development

Hooking iOS Delegates with Method Swizzling and Proxy Patterns: Challenges, Crash Analysis, and Compatibility Solutions

This article explores using AOP techniques such as Method Swizzle and NSProxy‑based delegate proxies to instrument iOS view controllers and collection view delegates, analyzes crashes caused by multiple setDelegate hooks—including interactions with RxCocoa—and proposes several practical solutions to ensure stable hooking in complex app environments.

Delegate ProxyHookingMethod Swizzling
0 likes · 17 min read
Hooking iOS Delegates with Method Swizzling and Proxy Patterns: Challenges, Crash Analysis, and Compatibility Solutions
Sohu Tech Products
Sohu Tech Products
Mar 3, 2021 · Mobile Development

Objective‑C Method Swizzling: Hook Order Analysis, Implementation Schemes, and Best Practices

This article examines Objective‑C method swizzling, compares two common implementation schemes, analyzes 18 inheritance‑hook scenarios for child‑first and parent‑first hook orders, and provides practical recommendations to ensure correct execution order and avoid crashes.

HookMethod SwizzlingObjective-C
0 likes · 14 min read
Objective‑C Method Swizzling: Hook Order Analysis, Implementation Schemes, and Best Practices
GrowingIO Tech Team
GrowingIO Tech Team
Nov 26, 2020 · Mobile Development

Mastering iOS AOP: From Method Swizzling to Fishhook and Beyond

This article explains the fundamentals of Aspect‑Oriented Programming on iOS, compares major AOP techniques such as Method Swizzle, Aspects, MPSwizzler, ISA‑swizzle KVO, Fishhook, Thunk and Clang instrumentation, and provides practical code examples and best‑practice guidelines.

Method SwizzlingObjective-CRuntime
0 likes · 21 min read
Mastering iOS AOP: From Method Swizzling to Fishhook and Beyond
JD Retail Technology
JD Retail Technology
Jun 28, 2020 · Mobile Development

Understanding iOS Runtime: Dictionary-to-Object Conversion, Associated Objects, and Method Swizzling

This article explains how iOS developers can use the Objective‑C runtime to automatically convert dictionaries to model objects, add properties to existing classes via associated objects, and implement method swizzling for tasks such as analytics injection, illustrating each technique with code flow and diagrams.

Associated ObjectsDictionary to ModelMethod Swizzling
0 likes · 7 min read
Understanding iOS Runtime: Dictionary-to-Object Conversion, Associated Objects, and Method Swizzling
JD Retail Technology
JD Retail Technology
May 21, 2020 · Mobile Development

Understanding the Sunglasses Crash Investigation Tool and Objective‑C Runtime Mechanisms

This article introduces the Sunglasses crash investigation tool, explains iOS Objective‑C runtime message handling—including method lookup, dynamic resolution, and forwarding—details method swizzling implementation with code examples, and discusses class clusters and future enhancements for mobile development debugging.

Crash HandlingMethod SwizzlingObjective-C
0 likes · 14 min read
Understanding the Sunglasses Crash Investigation Tool and Objective‑C Runtime Mechanisms
Sohu Tech Products
Sohu Tech Products
Sep 11, 2019 · Mobile Development

Understanding and Reimplementing Apple's Main Thread Checker on iOS

This article explores Apple's libMainThreadChecker.dylib implementation, details its environment variables and swizzling logic, demonstrates how to replicate its functionality by enumerating UIKit classes and hooking methods, and discusses pitfalls of full‑method hooking and a bridge‑based solution for reliable runtime monitoring.

Main Thread CheckerMethod SwizzlingObjective-C
0 likes · 15 min read
Understanding and Reimplementing Apple's Main Thread Checker on iOS
Hujiang Technology
Hujiang Technology
Jun 26, 2017 · Mobile Development

iOS Network Monitoring: NSURLProtocol, Hook Techniques, and NSURLSessionTaskMetrics

The article explains the challenges of mobile network environments in China, introduces connection migration issues, and presents iOS network monitoring solutions using NSURLProtocol, code injection (Hook) with Method Swizzling, NSProxy, and Fishhook, as well as detailed usage of NSURLSessionTaskMetrics for performance analysis.

FishhookHookMethod Swizzling
0 likes · 18 min read
iOS Network Monitoring: NSURLProtocol, Hook Techniques, and NSURLSessionTaskMetrics