SwizzleSwift
Swizzle selectors with just one clean and elegant API
Install / Use
/learn @MarioIannotta/SwizzleSwiftREADME
SwizzleSwift
Who said that method swizzling needs to look ugly? SwizzleSwift is a little wrapper that lets you swizzle selectors just one clean and elegant API.

Installation
Pods
pod 'SwizzleSwift'
Swift package manager
From Xcode, select File → Swift Packages → Add Package Dependency → Select your project → Search SwizzleSwift
Usage example
Swizzle(<#AType.Self#>) {
<#OriginalSelector#> <-> <#SwizzledSelector#>
}
Given the following controller
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
print(#function)
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
print(#function)
}
}
extension UIViewController {
@objc private func myViewDidLoad() {
print(#function)
myViewDidLoad()
}
@objc private func myViewWillAppear(_ animated: Bool) {
print(#function)
myViewWillAppear(animated)
}
}
Swizzling the methods like this
extension UIViewController {
@objc static func methodSwizzling() -> Void {
Swizzle(ViewController.self) {
#selector(viewDidLoad) <-> #selector(myViewDidLoad)
#selector(viewWillAppear(_:)) <-> #selector(myViewWillAppear(_:))
}
}
}
Will produce the following output
myViewDidLoad()
viewDidLoad()
myViewWillAppear(_:)
viewWillAppear(_:)
Related Skills
node-connect
343.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
90.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
