Day 16: Exceptions - String to Integer

  • + 0 comments

    Not working for me either with following code:

    func stringToInt(inputString: String) throws -> Int {
        // Write your code here
        if let num = Int(inputString) {
            return num
        }
        throw StringToIntTypecastingError.BadString
    }