This type of problem occurs when you try to connect a ViewController to a class that has another class mentioned in the Identity Inspector storyboard. Make sure your view controller has the same class name as in the storyboard you are trying to connect to.
As shown in the figure, make sure that the class name is correct to which you are trying to connect.

Thanks!
source share