I am working on calendar using Swift3
. I know it's possible to set same values for different keys.
I have this NSArray
called Dictionary
of JSON
objects:
if parsedData["status"] as! Int == 200 {
if let Streams = parsedData["data"] as! [AnyObject]? {
for Stream in Streams {
print(Stream)
}
Stream result: {
"-" = 4;
1 = X;
10 = H;
11 = X;
12 = X;
13 = X;
14 = X;
15 = X;
16 = X;
17 = H;
18 = X;
19 = X;
2 = X;
20 = X;
21 = X;
22 = X;
23 = L;
24 = H;
25 = X;
26 = L;
27 = "-";
28 = "-";
29 = "-";
3 = H;
30 = "-";
4 = X;
5 = X;
6 = X;
7 = X;
8 = X;
9 = X;
H = 4;
L = 2;
X = 20;
blank = "";
classid = id;
classname = " (A)";
stdid = 1;
stdnm = "name"; }
Here 1 to 31 are constants days of depend on month. X H L are leaves , normal leaves, and normal. I need to check x, h , l values and getting dates.
However, I don't know exactly the logic to check if the values is the same, then add its value to the same key.
Please help me. Thanking you
Please check :
This is for your JSON Format
Below is for dictionaries
Option 1 Pass the key and will return dates array
Option 2 Pass multiple keys and will return dictionary with dates array associated with each key