Swift - "use of unresolved identifier"

1) Right Click your MainViewController.swift

2) Select Show File Inspector

3) On Right side panel, look at Target Membership

4) Add your class to target by check the box :)


This same issue happened with me too. I've only one target membership and still, I was getting “use of unresolved identifier”. I build the project and nothing changed.

I tried to uncheck and recheck the target membership and the issue was resolved.

If this doesn't resolve your issue, try building the project, check for typo error or use autocompletion and Quick Help to find recognized identifiers.