iOS 13 を使用するようにアプリをアップグレードしています。現在の画面に画像を追加するために UIWindow を使用しています。ただし、ios 13 では画像が表示されますが、すぐに消えます。以前のバージョンである ios 12.2 でビルドしてみましたが、問題なく動作しています。
これは私のコードです:
UIWindow *currentWindow = [UIApplication sharedApplication].keyWindow;
UIImage *image = [UIImage imageNamed:@"test_badge" inBundle:VTBundle compatibleWithTraitCollection:nil];
UIImageView *badgeImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, [currentWindow bounds].size.height-115, 115, 115)];
badgeImageView.tag =100101;
badgeImageView.image = image;
[currentWindow addSubview:badgeImageView];