private API and UISheetPresentationController.Detent

Hello Guys!

I want to use detent with custom size, we have a public API(customDetentWithIdentifier:resolver:) but is just for iOS 16+ and I want to use in iOS 15.0, If I use a private API like this

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UISheetPresentationControllerDetent (Private)

  • (UISheetPresentationControllerDetent *)_detentWithIdentifier:(NSString *)identifier constant:(CGFloat)constant;

@end

NS_ASSUME_NONNULL_END

Then to use in Swift like this:

let modalViewDente: UISheetPresentationController.Detent = ._detent(withIdentifier: "ModalViewDente", constant: 300.0)

Can my app rejected by apple?

If Yes why? Why are they not given to us a way to do also in iOS 15?