Skip to content

Category class is overriding the SKStoreProductViewController methods #332

Description

@jangirtony2009

@implementation SKStoreProductViewController (CustomMethods)

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [super touchesBegan:touches withEvent:event];
    if (@available(iOS 17.2, *)) {
        [self loadProductWithParameters:productParameters completionBlock:nil];
    }
}

- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskAll;
}

- (BOOL)shouldAutorotate {
    UIInterfaceOrientationMask applicationSupportedOrientations = [[UIApplication sharedApplication] supportedInterfaceOrientationsForWindow:[[UIApplication sharedApplication] keyWindow]];
    UIInterfaceOrientationMask viewControllerSupportedOrientations = [self supportedInterfaceOrientations];
    return viewControllerSupportedOrientations & applicationSupportedOrientations;
}

@end

I encountered an issue because of overridden methods in the SKStoreProductViewController category class. My view controller logic is not getting honored. This is affecting my app's logic. I suspect this might be related to the implementation in Pubnative's HyBid iOS SDK.

According to Apple’s guidelines, while creating category classes is permissible, overriding class methods within them can alter the behavior of the entire app.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions