Question: Swift/Xcode playground help! In an xcode playground, Create a function, called check , that takes in an Int and returns an optional String. The input

Swift/Xcode playground help!

In an xcode playground,

Create a function, called check, that takes in an Int and returns an optional String.

The input parameter should be called value.

If the passed in argument is negative or zero, return nil.

Else return a string version of the argument.

Example:

let numberString1: String? = check(value: 10) // numberString should be "10"

let numberString2: String? = check(value: 0) // numberString should be nil

let numberString3: String? = check(value: -2) // numberString should be nil

Swift/Xcode playground help! In an xcode playground, Create a function, called check,

Running Functions 8 E Functions 1 1: Playground- noun: a place where people can play 3 import UIKit 4

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!