iOS Error Handling in Swift Error Handling Handling Errors

Bastian Petersson
Bastian Petersson
5,780 Points

I don't know how to tackle this task.

I don't know how to tackle this task. Can someone help me?

Thanks

error.swift
enum ParserError: Error {
  case emptyDictionary
  case invalidKey
}

struct Parser {
  var data: [String : String?]?

  func parse() throws {

  }
}

let data: [String : String?]? = ["someKey": nil]
let parser = Parser(data: data)

1 Answer

Jeff McDivitt
Jeff McDivitt
21,366 Points

Have you started this task or are you just drawing a complete blank for it?