presentViewController[swift,Objective-C,ios13]

iOS13から画面遷移をするとポップアップしたようになりスワイプでもviewを消せるようになった。

私のアプリでA→B(問題があるView、スワイプ)→A→B(dissmissボタンを押す)この時に何故か落ちる。

Fatal Exception: NSInternalInconsistencyException Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.

メインスレッドにキューを入れればいいようだが入れても直らなかった。

iosにそんな時間をかけたくなかったのでスワイプをそもそもできなくした。(画面をフルにした。)

Appdelegate.m obj-c

FilterNewShowViewController *shopViewC = [[FilterNewShowViewController alloc] initWithNibName:@"FilterNewShowViewController" bundle:[NSBundle mainBundle]];

>>>>shopViewC.modalPresentationStyle =  UIModalPresentationFullScreen;  

>>>>shopViewC.modalInPopover = YES;  //スワイプで消えなくなる。

self.window.rootViewController = shopViewC;

[self.window makeKeyAndVisible];
Viewcontroller.m obj-c
FilterNewShowViewController *shopViewC = [[FilterNewShowViewController alloc] initWithNibName:@"FilterNewShowViewController" bundle:[NSBundle mainBundle]];
>>>>shopViewC.modalPresentationStyle = UIModalPresentationFullScreen; //表示形式の選択
>>>>shopViewC.modalInPopover = YES; //スワイプで消えなくなる。
[self presentViewController:shopViewC animated:YES completion:nil];
Viewcontroller.swift
let vc = UIViewController()
>>>>vc.modalPresentationStyle = .fullScreen;
>>>>vc.isModalInPresentation = true;
present(vc, animated: false, completion: nil)

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

CAPTCHA