MonkeyPaws
public class MonkeyPaws: NSObject, CALayerDelegate
A class that visualises input events as an overlay over your regular UI. To use, simply instantiate it and keep a reference to it around so that it does not get deinited.
You will want to have some way to only instantiate it for test usage, though, such as adding a command-line flag to enable it.
Example usage:
var paws: MonkeyPaws?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
if CommandLine.arguments.contains("--MonkeyPaws") {
paws = MonkeyPaws(view: window!)
}
return true
}
-
Create a MonkeyPaws object that will visualise input events.
Declaration
Swift
public init(view: UIView, tapUIApplication: Bool = true)
Parameters
view
The view to put the visualisation layer in. Usually, you will want to pass your main
UIWindow
here.tapUIApplication
By default, MonkeyPaws will swizzle some methods in UIApplication to intercept events so that it can visualise them. If you do not want this, pass
false
here and provide it with events manually. -
If you have disabled UIApplication event tapping, use this method to pass in
UIEvent
objects to visualise.Declaration
Swift
public func append(event: UIEvent)