diff --git a/Objective-C/TOCropViewControllerTests/TOCropViewControllerTests.m b/Objective-C/TOCropViewControllerTests/TOCropViewControllerTests.m index 57f98510..1b0c7f4c 100644 --- a/Objective-C/TOCropViewControllerTests/TOCropViewControllerTests.m +++ b/Objective-C/TOCropViewControllerTests/TOCropViewControllerTests.m @@ -19,11 +19,11 @@ @implementation TOCropViewControllerTests - (void)testViewControllerInstance { //Create a basic image - UIGraphicsBeginImageContextWithOptions((CGSize){10, 10}, NO, 1.0f); - CGContextFillRect(UIGraphicsGetCurrentContext(), (CGRect){0,0,10,10}); - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - + UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:CGSizeMake(10, 10)]; + UIImage *image = [renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull context) { + [context fillRect:CGRectMake(0, 0, 10, 10)]; + }]; + //Perform test TOCropViewController *controller = [[TOCropViewController alloc] initWithImage:image]; UIView *view = controller.view;