I\'m trying to add edit some code from Apple\'s QuestionBot. I came up with this:
func responseToQuestion(question: String) -> String {
if question.h
Missing return in a function expected to return 'String'
should the function return
something , because you did not set return
if do not match any one question.hasPrefix()
func responseToQuestion(question: String) -> String {
if question.hasPrefix("hello") {
return "Hello"
} else if question.hasPrefix("where") {
return "There"
} else if question.hasPrefix("what"){
return "I don't know"
}
return "something"
}