Reputation: 2550
It there any reason why Xcode crashes frequently when using self defined Enum. For example BlurAction.ChangeMode(.Off)
, this line of code always make Xcode crashes.
Edit: I am using Xcode Version 7.2 (7C68).
I have the following code in two separate files.
TiltShiftMode.swift
enum TiltShiftMode {
case Radial
case Linear
case Off
}
BlurControlAction.swift
enum BlurControlAction: Action {
case Tap(CGPoint)
case ChangeMode(TiltShiftMode)
}
Action.swift
// A marker protocol with no requirements.
public protocol Action {
}
Then in a ViewController.swift
file type the following line
let action = BlurControlAction.ChangeMode(.Off)
Right after I type the dot before the Off, Xcode show an encounter internal error
message.
Upvotes: 1
Views: 214
Reputation: 535860
Then in a view controller file, I add the following line
let action = BlurControlAction.ChangeMode(.Off)
. Right after I type the dot before the Off, Xcode show an encounter internal error message.
Well, you don't get the same crash if you type the line this way:
let action = BlurControlAction.ChangeMode(TiltShiftMode.Off)
So I would suggest typing it that way for now (and filing a bug with Apple).
Upvotes: 3