实际上,我将navigationcontroller设置为根控制器,并将其嵌入主.storyboard中。我有两个屏幕:一个登录屏幕和另一个主屏幕。根据登录凭证,我需要跳过登录屏幕并显示主屏幕。从appdelegate中进行此跳过操作时出现了问题。
Unbalanced calls to begin/end appearance transitions for <UINavigationController: 0x7fadf384c600>.
let storyboard=UIStoryboard.init(name: "Main", bundle: nil)
let navigationController=storyboard.instantiateInitialViewController()
let username=UserDefaultUtil.getString(key: AppConstants.PREF_USERID)
print(username!)
if username != ""
{
window?.rootViewController=navigationController
let sectionController=SectionController(nibName: "SectionController" , bundle: nil)
navigationController?.present(sectionController, animated: true, completion: nil)
}