Q: Playground Execution error: Signal SIGABRT while parsing JSON string I'm really not sure why the JSON parsing causes a SIGABRT error.    
class Bug {
    enum State {
        case open
        case closed
    }

    let state: State
    let timestamp: Date
    let comment: String

    init(state: State, timestamp: Date, comment: String) {
        self.state = state
        self.timestamp = timestamp
        self.comment = comment
    }

    init(jsonString: String) throws {

        let dict = convertToDictionary(from: jsonString)

I think this is what is causing the error but I couldn't figure out why:
        self.state = dict["state"] as! Bug.State

        self.comment = dict["comment"] as! String

        self.timestamp = dict["timestamp"] as! Date
    }
}

JSON string to dictionary:
func convertToDictionary(from text: String) -> [String: Any] {
    guard let data = text.data(using: .utf8) else { return [:] }
    let anyResult: Any? = try? JSONSerialization.jsonObject(with: data, options: [])
    return anyResult as? [String: Any] ?? [:]
}

enum TimeRange {
    case pastDay
    case pastWeek
    case pastMonth
}

Error image: 

A: This line appears to be a problem:
self.state = dict["state"] as! Bug.State
Bug.State is a custom type of enum.  But the value in dict["state"] is a String.  by using as! you are telling the compiler that you know that will be a Bug.State at runtime, but when the system looks while the app is running it finds out that it is a String which is not a Bug.State so it throws an exception.
Similarly on the line that sets the timestamp you are trying to convert what is probably a string into a date using straight type casting.  You are going to have to use an NSDateFormatter to extract the date from the string to covert that value into a String.
