Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for iOS 17 #127

Open
nj-bss opened this issue Nov 22, 2023 · 1 comment
Open

Support for iOS 17 #127

nj-bss opened this issue Nov 22, 2023 · 1 comment

Comments

@nj-bss
Copy link

nj-bss commented Nov 22, 2023

Starting in iOS 17, UIGraphicsBeginImageContext will no longer be available. While your library is using this in the below method:

- (UIImage *)blurredScreenShotWithRect:(CGRect)rect
{
	
UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0);

Is anyone looking at making this library iOS 17 compatible?

@egor-bulgakov
Copy link

Try this code

- (UIImage *)blurredScreenShotWithRect:(CGRect)rect
{
    UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:rect.size];
        
    UIImage *blurredScreenShot = [renderer imageWithActions:^(UIGraphicsImageRendererContext *context) {
        [self.originalKeyWindow drawViewHierarchyInRect:rect afterScreenUpdates:NO];
    }];
    
    blurredScreenShot = [self applyTintEffectWithColor:self.configuration.backgroundTintColor
                                                 image:blurredScreenShot];
    
    return blurredScreenShot;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants