That looks suspiciously like some kind of PNG file, not a text file. ("PNG" followed by "IHDR", specifically.) Are you sure that's a Swift file and not a screenshot of a Swift file or something?
That's also a very strange title in the titlebar of your screenshot. Perhaps that is related.
Either way, seems pretty clear that these allegedly Swift files are actually some format which is not plain text. Copy the text out of it into a new file created from scratch by Xcode, and that will fix whatever the problem is.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.