“Dicionário rápido” Respostas de código

Crie dicionário Swift

var someDict:[String:Int] = ["One":1, "Two":2, "Three":3] // creates dictionary
var someVar = someDict["One"] // accesses the value of key "One"

print("The value of key = One is \(someVar)")
sej

Dicionário rápido

// dictionary with keys and values of different data types
var numbers = [1: "One", 2: "Two", 3: "Three"]
print(numbers)
SAMER SAEID

Crie um dicionário em Swift

var capitalCity = ["Nepal": "Kathmandu", "Italy": "Rome", "England": "London"]
print(capitalCity)
SAMER SAEID

Como obter lista de valor de teclas específicas no objeto Array em Swift

import Foundation

let strings = [
    "one",
    "two",
    "three"
]

let ints = strings.map { (string) -> Int in
    return string.count
}
Homeless Hare

Respostas semelhantes a “Dicionário rápido”

Procure respostas de código populares por idioma

Procurar outros idiomas de código