stormborn 0.2.0

stormborn 0.2.0

Maintained by Oliver Letterer.



stormborn 0.2.0

🌪 stormborn

Lazy method swizzling, limited to 20 arguments.

Example

without arguments

UIView.swizzle🌪.layoutSubviews { (object, sup) -> in
    sup.invoke()
}

with arguments

UIViewController.swizzle🌪.viewDidAppear { (object, animated: Bool, sup) -> in
    sup.invoke(animated)
}

multiple arguments and return types

class Greeter: NSObject {
    @objc dynamic func greet(first: String, last: String) -> String {
        return "Hello \(first) \(last)"
    }
}

Greeter.swizzle🌪.greetWithFirstlast { (object, arguments: (first: NSString, last: NSString), sup) -> NSString in
    return sup.invoke(arguments.first, arguments.last)
}

Author

Oliver Letterer, [email protected]

License

stormborn is available under the MIT license. See the LICENSE file for more info.