UIWindow

class UIWindow : UIView

This extesion adds some useful functions to UIWindow.

  • Take a screenshot of current window and choose if save it or not.

    Declaration

    Swift

    public func windowScreenshot(save: Bool = false) -> UIImage?

    Parameters

    save

    Set to true to save, otherwise false.

    Return Value

    Returns the screenshot as an UIImage.

  • Take a screenshot of current window, choose if save it or not after a delay.

    Declaration

    Swift

    public func windowScreenshot(delay: Double, save: Bool = false, completion: @escaping (_ screenshot: UIImage?) -> Void)

    Parameters

    delay

    The delay, in seconds.

    save

    Set to true to save, otherwise false.

    completion

    Completion handler with the UIImage.

    screenshot

    The screenshot image.

  • Show touch on screen.

    Declaration

    Swift

    public func activateTouch()
  • Hide touch on screen.

    Declaration

    Swift

    public func deactivateTouch()