Function

UIGraphicsEndImageContext()

Removes the current bitmap-based graphics context from the top of the stack.

Declaration

func UIGraphicsEndImageContext()

Discussion

You use this function to clean up the drawing environment put in place by the UIGraphicsBeginImageContext(_:) function and to remove the corresponding bitmap-based graphics context from the top of the stack. If the current context was not created using the UIGraphicsBeginImageContext(_:) function, this function does nothing.

This function may be called from any thread of your app.

See Also

Image Creation

func UIGraphicsBeginImageContext(CGSize)

Creates a bitmap-based graphics context and makes it the current context.

func UIGraphicsGetImageFromCurrentImageContext() -> UIImage?

Returns an image based on the contents of the current bitmap-based graphics context.

func jpegData(compressionQuality: CGFloat) -> Data?

Returns the data for the specified image in JPEG format.

func pngData() -> Data?

Returns the data for the specified image in PNG format