As of recently I experience some troubles with Xcode's 6 code editor, which conclude in rapid change of focus in the editing window, jumping to a completely different place in the same file, while editing text. This is how it all started. Lately the editor refuses to scroll up and down, hangs, stops displaying the line numbers, or any other text altogether. What can I do to make it stop misbehave? All the solutions I found thus far are concerning older versions of Xcode and do not work for me.
Update: I initially thought it was the Optionals. There is a point in my code where I do this:
tile?.position.vertical >= 2
I presumed that by comparing the optional to a value, I messed with the compiler and I was supposed to compare it only to nil. Subsequent testing proved me wrong. Then I notices something in one of my enumerations:
enum Figure: Int {
case King = 0
case Pawn = 1
case Bishop = 3
case Knight = 5
case Rook = 7
case Queen = 9
func pieceName() -> String {
switch self {
case .Pawn:
return "Pawn"
case .King:
return "King"
case .Bishop:
return "Bishop"
case .Knight:
return "Knight"
case .Rook:
return "Rook"
case .Queen:
return "Queen"
}
}
}
Notice how nicely the code gets coloured in the switch statement, obviously Pawn, King and so on are a part of the same enumeration. Well, not in my case. My copy of Xcode will say "Symbol not found" when I command-click one of the case values in the function. So, what do you think could this be the culprit to my troubles and if yes, how can I fix it?