This is my simple button action to show a XIB file which is actually a bar code scanner in Objective-C.
- (IBAction)startCamera:(id)sender {
BarcodeVC * controller = [[BarcodeVC alloc] initWithNibName:@"BarcodeVC" bundle:[NSBundle mainBundle]];
//[self presentViewController:controller animated:YES completion:nil];
UIWindow * currentwindow = [[UIApplication sharedApplication] keyWindow];
[currentwindow.rootViewController presentViewController:controller animated:YES completion:nil];
}
But unfortunately, a warning comes which is:
keyWindow
is deprecated: first deprecated in iOS 13.0
I know that since iOS 13 supports the multiple scenes, but Is there any way to solve this in Objective-C? I have seen Swift versions, but I was unsuccessful with Objective-C.