SKStoreProductViewController使用
2020-11-20 本文已影响0人
爱豆一颗心
SKStoreProductViewController *skStoreProductViewController = [[SKStoreProductViewController alloc] init];
[skStoreProductViewController setDelegate:self];
[skStoreProductViewController loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier : @"1173412177"}
completionBlock:^(BOOL result, NSError *error) {
if (error) {
NSLog(@"Error %@ with User Info %@.", error, [error userInfo]);
} else {
// Present Store Product View Controller
[self presentViewController:skStoreProductViewController animated:YES completion:^{
for(int i =0; i < skStoreProductViewController.view.subviews.count; i++) {
UIView *subView = skStoreProductViewController.view.subviews[i];
subView.frame = CGRectMake(0, 100, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height);
}
}];
}
}];