Hen Shabat Hen Shabat - 4 months ago 4x
Swift Question

How to get one String of dictionary that used as key from [String:Bool] in Swift

I have a dictionary:

var markedDays: [String : Bool] = [
"Sun" : true,
"Mon" : true,
"Tue" : true,
"Wed" : true,
"Thu" : true,
"Fri" : true,
"Sat" : true

Is there a way to use one string from my keys? Like
for example?
I need to compare it to another


Dictionary is unordered collection, why don't you just use Array instead of Dictionary:

let markedDays: [(String,Bool)] = [ ("Sun",true), ("Mon",true), ("Tue",true), ("Wed",true), ("Thu",true), ("Fri",true), ("Sat",true) ]

let day = markedDays[0].0