TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

xcode not showing up variable type when i use command to bring up ? mark

Forums > iOS

Any idea? It just says no documentation.

import Foundation

struct Game { var target: Int = Int.random(in: 1...100) var score: Int = 0 var round: Int = 1

func points(sliderValue) -> Int {
let difference = abs(target - sliderValue)

    // or difference*= -1
    // or difference = -difference
    let awardedPoints = 100 - difference
    return awardedPoints
}

}

difference is an int but its not showing up like this

   

Hacking with Swift is sponsored by String Catalog.

SPONSORED Get accurate app localizations in minutes using AI. Choose your languages & receive translations for 40+ markets!

Localize My App

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.