Question: this is done in swift apple programming don't know how to make it see if there is a string in there or not /*: Write

this is done in swift apple programming don't know how to make it see if there is a string in there or not

/*:

Write an if statement that will use `isEmpty` to check if there is anything in the array. If there is not, print a statement asking the user to commit to a challenge. Add an else-if statement that will print "The challenge you have chosen is " if the array count is exactly 1. Then add an else statement that will print "You have chosen multiple challenges."

*/

let userPickedChallenges: [String] = []

if userPickedChallenges.isEmpty {

print("Please input a daily challenge.")

}

if userPickedChallenges.contains() {

print("The challenge you have chosen is walk 1 mile.")

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!