Hi, guys I need help solving this question that involves function and optionals : Im done with the first part, I need help with second question that involves updating the function to return an Int. Ive tried to solve it but what I get is an error

If an app asks for a user's age, it may be because the app requires a user to be over a certain age to use some of the services it provides. Write a function called checkAge that takes one parameter of type String. The function should try to convert this parameter into an Int value and then check if the user is over 18 years old. If he/she is old enough, print "Welcome!", otherwise print "Sorry, but you aren't old enough to use our app." If the String parameter cannot be converted into an Int value, print "Sorry, something went wrong. Can you please re-enter your age?" Call the function and pass in userInputAge below as the single parameter. Then call the function and pass in a string that can be converted to an integer.

Go back and update your function to return the age as an integer. Will your function always return a value? Make sure your return type accurately reflects this. Call the function and print the return value.


    func checkage(age: String)->Int?
    {
    if let age_type = Int(age)
    {
    if age_type > 18 {
    return "Welcome!"
    }
    else if age_type < 18 {
    return"Sorry, but you aren't old enough to use our app."
    }
    }
    else {
    return "Sorry, something went wrong. Can you please re-enter your age?"
    }
    return age_type
    }
    
    print(checkage(age:"23"))
    
    error: 3. Exercise - Functions and Optionals.xcplaygroundpage:20:12: error: use of unresolved identifier 'age_type'
    return age_type
    ^~~~~~~~