This happened to me in Swift 3.1, Xcode 8.3.2 for a month, I encoded everything in order, but it came to the point that all the text was just plain text, no colors, no autocomplete, no indentation, What a torture ... ..
Xcode showed an error for NSAttributedString , but it compiled fine, I could even see the underlined button in the application without problems. When I deleted this code, xcode returned to its normal state. How strange.
It's time to find out. I checked every commit from github until I found a version of my project that does not throw An internal error occurred. The functionality of the source code editor is limited. .
Then I compared the commit versions, and I decided that it started when I edited the UIButton text through code.
Error due to NSAttributedString I wanted to underline the button text as follows
let titleAttributes:[String : Any] = [NSForegroundColorAttributeName : Constants.forgotPassColor, NSUnderlineStyleAttributeName : NSUnderlineStyle.styleSingle.rawValue] let localizedForgotPass = NSLocalizedString("forgotPassword", tableName: "Localizable", comment: "forgot button text") let titleString = NSAttributedString(string: localizedForgotPass, attributes: titleAttributes) forgetPasswordButton.setAttributedTitle(titleString, for: .normal)
Removing this resolved. Something is wrong with NSAttributedString in Swift 3.1
u.gen May 19 '17 at 21:33 2017-05-19 21:33
source share