Note: I\'ve search a lot, such as Invalid redeclaration of UITableViewDataSource method? not apply to my case. For there is no duplicate file or class in m
If it is added twice, then added one file.
I add this answer as a supplement of pkc456's answer.
Both redeclaration and recompile can cause the issue.
In my code there is no redeclaration, so it's the recompile cause it.
I go to the Build phases menu, and I found the AppDelegate.swift file added twice there.
Solution:
Select either of the two AppDelegate.swift file, and click the - to remove it.
Clean and build the project(For Xcode Version 9.3 (9E145) Product->Clean and Product->Build).