Swift setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key

Okay I just faced the same issue and it was due to having multiple targets. I couldn't figure out why it would run perfectly fine in some instances, yet not others. The issue is actually with the Module definition on the view controller, I'm guessing that this may explain why when you completely recreate the controller the issue seems magically fixed. On mine I had the Module set to one of my targets, so when I ran a second target it wasn't associated. If you have multiple targets make sure you empty the Module box on the VC that crashes (on your storyboard) and tick Inherit Module From Target.

Hope this helps

enter image description here


Check that your class is the same that you use in storyboard

enter image description here


if you tick checkbox inhertite done should check key in log alert or look in source and then delete in alert ui

in same picture

try check.

if you find alrt same picture delete it.

enter image description here