ios - View Controller Loads Twice - How Do I Fix It? -


the problem cause

when added new swift class file ios project, decided indecisive , renamed it, deleted it, , created new file. think indecisive renamed few times.

the problem

now viewcontroller loads twice. can literally see transition happen twice and, during testing, can see viewdidload run twice in console.

common fix

i know first solution check duplicate segues / segue calls. check document outline see if there's more 1 segue. in case, not segue problem in storyboard or viewcontroller.

my uncommon situation

i found had same load-twice problem , because of rename:

screenshot

they said renaming did @ root of problem , not easy fix because duplication in xml file. xml file , how edit erase original instance of class? have no idea.

so how solve loads-twice issue? want viewcontroller have normal segue!

resolved issue!

if messed around class's name (or it's file name) , have same "loads twice" issue having, might having hard time solving it. suggested solutions found said create new project scratch , copy stuff over. but, instead...

here's simplest solution ever:

rename class of viewcontroller that's loading twice! don't worry file, view controller class within it. xml file has duplicates of original class name, rename class entirely new , should okay.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -