1
00:00:07,790 --> 00:00:09,850
Hey everybody this is Kayla with slopes.

2
00:00:09,870 --> 00:00:14,510
And in this video we're going to start downloading information from the flicker API.

3
00:00:14,730 --> 00:00:20,820
We just got our API key in the last video and we wrote a function that can build us a nice u r l that's

4
00:00:20,820 --> 00:00:23,370
perfect for accessing the API.

5
00:00:23,640 --> 00:00:28,770
But in this video we're going to go ahead and retrieve a list of the you are Elle's for all of the photos

6
00:00:28,770 --> 00:00:30,190
that we're going to download.

7
00:00:30,210 --> 00:00:34,610
Then in the next video we're going to write another function to retrieve all of the images.

8
00:00:34,770 --> 00:00:38,520
I wanted to separate these two because they're a little beefy and we're going to be diving through some

9
00:00:38,520 --> 00:00:42,230
of the Jaison parsing through it and it can get a little intense.

10
00:00:42,230 --> 00:00:45,550
So I just wanted to separate these functions into two separate videos.

11
00:00:45,620 --> 00:00:46,950
So let's let's get started.

12
00:00:46,950 --> 00:00:54,300
Pull open that X code project and we're actually going to start by going to our map Visi and we're going

13
00:00:54,300 --> 00:00:59,960
to write two functions one for retrieving all of you or else that will be this video.

14
00:01:00,120 --> 00:01:04,110
And then in the next video we're going to write retrieve images which is going to download all the images

15
00:01:04,110 --> 00:01:06,060
using Alamo fire image.

16
00:01:06,060 --> 00:01:07,130
Very cool.

17
00:01:07,140 --> 00:01:13,940
Let's go ahead and at the very bottom of our class here let's go ahead and write phunk retrieve you

18
00:01:14,000 --> 00:01:19,560
ourselves and we're going to retrieve you or else for an annotation.

19
00:01:19,560 --> 00:01:22,180
Right because we drop the annotation on our map view.

20
00:01:22,500 --> 00:01:27,540
And when we drop that annotation it has coordinates and we need to pass those in.

21
00:01:27,540 --> 00:01:31,290
So go ahead and type retrieve your elves for annotation.

22
00:01:31,290 --> 00:01:37,930
Give it an internal parameter of annotation and that is of type drop a pin our custom annotation.

23
00:01:37,950 --> 00:01:42,870
Now we're also going to use a completion handler because we need to know when we're done loading all

24
00:01:42,870 --> 00:01:49,650
of these you are else to call retrieve images because once that's done once they're done then we need

25
00:01:49,650 --> 00:01:54,510
to notify retrieve images that it should start downloading images from those you or else.

26
00:01:54,510 --> 00:01:55,030
OK.

27
00:01:55,230 --> 00:02:02,760
So to make a completion handler just go ahead and type handler and it's going to be of type escaping.

28
00:02:02,780 --> 00:02:07,470
K that means that the values can escape the ones that we pass into this handler can escape out of this

29
00:02:07,470 --> 00:02:11,640
function and talk to another function in our circumstance.

30
00:02:11,670 --> 00:02:19,080
Now we need to put a function in here because that's how completion handlers work is that we're basically

31
00:02:19,080 --> 00:02:25,710
going to pass in values to this function and then we can pass that down as soon as it's done to the

32
00:02:25,710 --> 00:02:27,080
next function or the next.

33
00:02:27,180 --> 00:02:29,250
The next thing that we need to do so.

34
00:02:29,370 --> 00:02:36,360
Handler escaping and then inside of here we're going to put an underscore status of type bool.

35
00:02:36,360 --> 00:02:38,010
OK that's the function.

36
00:02:38,010 --> 00:02:44,670
And then we're going to return an empty an empty parentheses.

37
00:02:44,670 --> 00:02:46,710
So we're not we're not returning anything.

38
00:02:46,830 --> 00:02:53,880
But you'll notice oh it's giving me an error we need to of course put curly brackets and that is our

39
00:02:53,910 --> 00:02:56,240
function that's the base of our function.

40
00:02:56,250 --> 00:02:59,310
Now you're wondering why are we putting this underscore here.

41
00:02:59,310 --> 00:03:03,690
Watch what happens if I get rid of it if I try to build it it's going to give me an error and say function

42
00:03:03,690 --> 00:03:06,390
types cannot have argument labels.

43
00:03:06,480 --> 00:03:11,600
So we have to use an underscore because we're not allowed to use the name for whatever reason.

44
00:03:11,610 --> 00:03:14,760
So now here is what we are going to do.

45
00:03:14,760 --> 00:03:19,790
We're going to first set up an array that's going to hold all of the image you are else.

46
00:03:19,890 --> 00:03:24,830
So go up to the top and we are going to create an array.

47
00:03:24,840 --> 00:03:27,250
Let's see where should we put it.

48
00:03:27,300 --> 00:03:29,390
Let's put it down here below the collection view.

49
00:03:29,760 --> 00:03:32,270
And we're going to call it image you Arel array.

50
00:03:32,280 --> 00:03:38,200
So go ahead and create an instance of it called var image your L array.

51
00:03:38,790 --> 00:03:47,010
And that's going to be of an array of type string and we're of course going to instantiate that as an

52
00:03:47,010 --> 00:03:48,710
array of type string.

53
00:03:48,890 --> 00:03:50,710
Ok image you are LRA.

54
00:03:50,730 --> 00:03:51,960
Very cool.

55
00:03:51,960 --> 00:03:58,710
Now when we go back to our function here retrieve you or else when we first start we want to close that

56
00:03:58,710 --> 00:03:58,980
out.

57
00:03:58,980 --> 00:04:01,370
We want to clear it out so that it is empty.

58
00:04:01,410 --> 00:04:04,330
So go ahead and type image Yoro and make it empty.

59
00:04:04,350 --> 00:04:10,200
This is because if let's say we downloaded all the images downloaded all your files I mean and then

60
00:04:10,200 --> 00:04:12,110
we double tap to drop a new pin.

61
00:04:12,120 --> 00:04:16,230
Suddenly we would be adding a bunch of your L's on top of the ones we already have.

62
00:04:16,230 --> 00:04:19,340
So we should clear it out every time that we call this.

63
00:04:19,550 --> 00:04:20,180
OK.

64
00:04:20,370 --> 00:04:21,270
Are you ready.

65
00:04:21,270 --> 00:04:24,100
We are about to move on to use Alamo fire.

66
00:04:24,270 --> 00:04:29,520
Elmo's Fire is how we're going to make a request and pull down data as Jason.

67
00:04:29,520 --> 00:04:30,900
So follow me here.

68
00:04:31,020 --> 00:04:33,260
We're going to type Alamo fire.

69
00:04:33,940 --> 00:04:36,330
Oh of course we need to import L.A. fire first.

70
00:04:36,330 --> 00:04:37,930
We haven't done that yet.

71
00:04:38,050 --> 00:04:44,360
Import the library Alamo fire in port Alamo fire.

72
00:04:44,370 --> 00:04:49,800
And you know while we're at it go ahead and import Alamo fire image and then scroll back down to where

73
00:04:49,800 --> 00:04:52,510
we were in retrieve you ourselves.

74
00:04:52,800 --> 00:04:53,250
OK.

75
00:04:53,460 --> 00:04:54,150
Go ahead and type.

76
00:04:54,150 --> 00:04:57,170
Alamo fire dot request.

77
00:04:57,180 --> 00:05:00,220
And we're going to choose the one with our El convertible.

78
00:05:00,240 --> 00:05:05,430
Now your old convertible allows us to pass in a string and this is where we're going to pass in our

79
00:05:05,430 --> 00:05:06,750
flicker you are el.

80
00:05:06,820 --> 00:05:12,960
So go ahead and call it flicker Jaro for API key we can pull API keys straight from our Constans file.

81
00:05:13,150 --> 00:05:19,570
The annotation here is going to be of course the annotation from our function and number of photos we're

82
00:05:19,570 --> 00:05:21,420
going to go ahead and let's just do 40.

83
00:05:21,630 --> 00:05:22,120
OK.

84
00:05:23,050 --> 00:05:24,380
So there's that.

85
00:05:24,640 --> 00:05:28,960
Our request has been made but we need to do something with this request.

86
00:05:28,960 --> 00:05:33,250
Now we need to go ahead and see what we're going to get as a response.

87
00:05:33,250 --> 00:05:36,920
So go ahead and type response Jason.

88
00:05:37,100 --> 00:05:37,720
OK.

89
00:05:38,230 --> 00:05:44,740
And this means that we want the data to be pulled down as Jason data as we saw in the previous video

90
00:05:44,750 --> 00:05:48,620
that's totally possible with the flicker API and so we're going to do it.

91
00:05:48,760 --> 00:05:55,540
So for the completion händler just press enter and we're basically going to be looking at the response.

92
00:05:55,540 --> 00:06:01,630
So go ahead and type response and this constant is going to hold the value of whatever Jaison we get

93
00:06:01,630 --> 00:06:02,600
back.

94
00:06:02,620 --> 00:06:08,290
So now we need to actually print the response just to see what we get.

95
00:06:08,290 --> 00:06:09,160
All right.

96
00:06:09,160 --> 00:06:12,610
That's that we're going to print the response we're going to see what we get and then we're going to

97
00:06:12,610 --> 00:06:17,230
parse through it so that we can get all of these nice image you are Elle's ready for us.

98
00:06:17,230 --> 00:06:22,260
So let's go ahead and let's call this function from somewhere.

99
00:06:22,330 --> 00:06:27,580
I think the best place we could call it would be from where we drop our pins so let's go to drop pan

100
00:06:28,300 --> 00:06:30,520
Let's go ahead and at the very bottom.

101
00:06:30,520 --> 00:06:36,490
Go ahead and call retrieve your else for annotation past the annotation that we make when we dropped

102
00:06:36,490 --> 00:06:40,900
the pin and for the handler we're going to go ahead and press enter.

103
00:06:40,900 --> 00:06:47,650
And if you saw the status here is a Boolean that means when it's finished we're going to call that.

104
00:06:47,710 --> 00:06:48,300
OK.

105
00:06:48,550 --> 00:06:49,620
Easy peasy.

106
00:06:49,660 --> 00:06:50,430
And you know what.

107
00:06:50,470 --> 00:06:55,690
At the end why don't we call it so that it just knows that it's done and that's when we'll know it's

108
00:06:55,690 --> 00:06:56,300
finished.

109
00:06:56,370 --> 00:06:56,880
OK.

110
00:06:57,280 --> 00:06:59,230
So we'll just say true.

111
00:06:59,830 --> 00:07:05,050
And in the code We'll just print or no you know we don't need to do anything actually when this runs

112
00:07:05,050 --> 00:07:07,060
it's just going to go ahead and print the response here.

113
00:07:07,240 --> 00:07:13,660
So let's go ahead and build and run this let's drop a pin and that will allow us to see what is getting

114
00:07:13,660 --> 00:07:23,180
downloaded from the Jason K we're zooming in here we go double click and it looks like hey hey we got

115
00:07:23,270 --> 00:07:26,430
a bunch of Jason here.

116
00:07:26,450 --> 00:07:27,560
All right look at that.

117
00:07:27,740 --> 00:07:31,670
We have the page the number of pages the items per page and then look at this.

118
00:07:31,670 --> 00:07:33,720
These are all of our photos here.

119
00:07:33,740 --> 00:07:35,950
There is lots of information here.

120
00:07:36,110 --> 00:07:44,900
So each photo has a farm an ID a property for is family is friend is public an owner a secret a server

121
00:07:44,930 --> 00:07:46,010
and a title.

122
00:07:46,010 --> 00:07:48,980
Lots of information for every single photo.

123
00:07:48,980 --> 00:07:50,580
Now I want to show you something.

124
00:07:50,810 --> 00:07:55,610
If you go to flicker dot com and you view any photo on the site you'll notice something interesting

125
00:07:55,610 --> 00:08:00,280
about the URL so let's go ahead and let's go find a photo.

126
00:08:00,350 --> 00:08:08,480
We can look at maybe this one here and let's see if I open the link.

127
00:08:08,630 --> 00:08:08,960
You know what.

128
00:08:08,960 --> 00:08:11,420
It's not going to let me access the photo I don't think.

129
00:08:11,420 --> 00:08:12,660
That's OK though.

130
00:08:12,950 --> 00:08:13,360
Oh yeah.

131
00:08:13,460 --> 00:08:16,070
Maybe download can download it here.

132
00:08:16,380 --> 00:08:20,470
And let's download a large sized image.

133
00:08:20,720 --> 00:08:24,920
I'm going to copy the link actually and then show you what the link looks like.

134
00:08:24,920 --> 00:08:30,170
Now I want you to notice one thing it says here farm one.

135
00:08:30,350 --> 00:08:36,830
Do you see how in these photos it says farm five farm five farm five farm five they're all farm five.

136
00:08:36,830 --> 00:08:39,330
This one's farm six farm nine.

137
00:08:39,560 --> 00:08:41,790
That's the way the you are is structured farm.

138
00:08:41,810 --> 00:08:45,670
And a number of statics liquor dot com slash.

139
00:08:45,920 --> 00:08:50,200
And then it has a server value for 1 5 6 2 8 2 2.

140
00:08:50,210 --> 00:08:52,790
This one is from server 6 7 9.

141
00:08:52,790 --> 00:08:55,700
Then we have an owner.

142
00:08:55,880 --> 00:08:57,920
The owner key is right here.

143
00:08:58,100 --> 00:08:58,450
OK.

144
00:08:58,460 --> 00:09:00,210
And that goes here.

145
00:09:00,590 --> 00:09:02,440
You can pass that right there.

146
00:09:02,810 --> 00:09:05,510
Actually sorry that's the idea the first one is the ID.

147
00:09:05,570 --> 00:09:08,470
The second is the secret.

148
00:09:08,480 --> 00:09:09,190
OK.

149
00:09:09,230 --> 00:09:16,910
And finally Kay is for a large photo and D goes at the end just as a standard part of how the RL is

150
00:09:16,910 --> 00:09:17,630
structured.

151
00:09:17,630 --> 00:09:23,870
So as you can see the URL is pretty complicated to parse and that's why I wanted to make this into a

152
00:09:23,870 --> 00:09:25,200
single video.

153
00:09:25,580 --> 00:09:27,060
I hope you can understand that.

154
00:09:27,060 --> 00:09:32,180
But thank you for being patient with it being just in a single video.

155
00:09:32,180 --> 00:09:36,210
So let's go ahead and let's actually look at what we're dealing with here.

156
00:09:36,230 --> 00:09:44,780
We have a dictionary first and foremost and inside that dictionary is another dictionary called photos.

157
00:09:44,810 --> 00:09:45,460
OK.

158
00:09:45,720 --> 00:09:52,130
Then inside of that dictionary there's an array which we can see here with that print see parentheses.

159
00:09:52,140 --> 00:09:54,520
There's an array of more dictionaries.

160
00:09:54,610 --> 00:09:58,310
OK these are all individual dictionaries for each photo.

161
00:09:58,310 --> 00:10:03,990
So we're going to have to go ahead and parse down through a dictionary which is the Jaison we receive

162
00:10:03,990 --> 00:10:09,410
initially then we're going to cast that as a dictionary and we'll cast that as an array of dictionaries.

163
00:10:09,410 --> 00:10:14,570
OK so let's go do that inside of our Alamo fire function.

164
00:10:14,570 --> 00:10:15,740
We know what the response is.

165
00:10:15,740 --> 00:10:17,030
That is a dictionary.

166
00:10:17,090 --> 00:10:23,210
So let's create a constant called Jaison and let's do this safely guard.

167
00:10:23,340 --> 00:10:27,950
Let Jaison equals response.

168
00:10:27,950 --> 00:10:37,070
And in order to get this Jaison information we can type response the result value ops response that

169
00:10:37,070 --> 00:10:40,800
result value.

170
00:10:41,090 --> 00:10:50,030
And we need to actually cast this as a dictionary of string and any object and I can see that each of

171
00:10:50,030 --> 00:10:56,030
these values here is a string and the object that can be returned can be an integer.

172
00:10:56,050 --> 00:11:01,730
Sometimes it can be a string sometimes it could be maybe a decimal place if it had a coordinate.

173
00:11:01,730 --> 00:11:06,500
So we're going to do string and any object to make sure that it's safe at the end of our guard statement

174
00:11:06,500 --> 00:11:06,920
we'll type.

175
00:11:06,920 --> 00:11:07,580
Else.

176
00:11:07,580 --> 00:11:12,110
And then of course we will return if there is a problem.

177
00:11:12,110 --> 00:11:18,800
So now we're going to use this Jasen which is a dictionary of string and any object we're going to use

178
00:11:18,800 --> 00:11:23,120
that in order to get into the photos dictionary.

179
00:11:23,120 --> 00:11:32,640
So let's go ahead and let's type let photos dep't for dictionary and make that equal to Jaison.

180
00:11:32,960 --> 00:11:37,720
And if you look the name of that element is called photos.

181
00:11:37,730 --> 00:11:42,830
So we're going to actually type photos and that's going to bring out that dictionary.

182
00:11:42,830 --> 00:11:46,210
Now of course we need to cast it as a dictionary of string

183
00:11:49,220 --> 00:11:51,260
and any object.

184
00:11:51,260 --> 00:11:52,740
And why are we doing that.

185
00:11:52,850 --> 00:11:59,690
Well if you look at the Jaison here we can see that Fotos has a little bracket here and inside of this

186
00:11:59,690 --> 00:12:05,260
dictionary there are some keys right and some values.

187
00:12:05,790 --> 00:12:11,890
And for photo photo is the key and the value is an array of a bunch of dictionaries of photos.

188
00:12:11,890 --> 00:12:12,460
OK.

189
00:12:12,590 --> 00:12:15,400
And we're going to get into that in just a moment.

190
00:12:15,440 --> 00:12:22,700
So now we have accessed the photos dictionary and we need to go a little bit deeper it's kind of like

191
00:12:22,700 --> 00:12:29,610
going into different levels of Inception we're going down into the third level of sleep.

192
00:12:29,630 --> 00:12:32,360
Sort of but not nearly as cool.

193
00:12:32,630 --> 00:12:35,420
Actually more cool because it's code and codes cool.

194
00:12:35,600 --> 00:12:37,850
So let's go ahead and do that.

195
00:12:37,850 --> 00:12:44,510
Let Fotos dictionary array because it's an array of photo dictionaries.

196
00:12:44,600 --> 00:12:46,920
We're going to make that equal to photos.

197
00:12:46,930 --> 00:12:47,610
DICT.

198
00:12:47,780 --> 00:12:53,370
And we're going to pull out the element called photo right because that's what we see.

199
00:12:53,370 --> 00:12:54,610
Photo is the key.

200
00:12:54,610 --> 00:12:55,850
And we want the value.

201
00:12:56,060 --> 00:12:58,010
So let's go ahead and call.

202
00:12:58,010 --> 00:13:02,290
Photo from photos dictionary array.

203
00:13:02,480 --> 00:13:11,520
And we're going to cast this as an array of dictionaries that are of type string and any object.

204
00:13:11,540 --> 00:13:12,150
All right.

205
00:13:12,230 --> 00:13:13,460
Easy enough.

206
00:13:13,880 --> 00:13:18,470
Now of course it's telling us that we're not using it yet but we're going to go ahead and cycle through

207
00:13:18,950 --> 00:13:24,640
all of those photos and we're going to generate a u r l based on the information that we have here.

208
00:13:24,650 --> 00:13:32,320
So for photo in photos dict array we're going to use a for loop cycle through all of them.

209
00:13:32,390 --> 00:13:37,630
We're going to first create a post u r l and then we're going to append it to our image you are LRA.

210
00:13:37,910 --> 00:13:42,580
So go ahead and create a constant called Let post you are ill.

211
00:13:42,980 --> 00:13:46,790
And for this we're actually going to go ahead and use a string.

212
00:13:46,790 --> 00:13:49,070
We're going to look at the your L from safari.

213
00:13:49,070 --> 00:13:52,240
We can see it starts with h TTP s.

214
00:13:52,370 --> 00:13:53,800
Backslash backslash.

215
00:13:53,810 --> 00:13:56,080
So let's go ahead and type that.

216
00:13:56,270 --> 00:13:57,230
Great.

217
00:13:57,230 --> 00:14:00,480
Next we have a farm and a number.

218
00:14:00,740 --> 00:14:08,630
So I know that farm can be typed but you know what we're going to need to get out the value from photo

219
00:14:08,870 --> 00:14:13,640
for the farm so to do that we're going to use string concatenation.

220
00:14:13,790 --> 00:14:20,870
We're going to call photo because remember that's its own dictionary and we can pull out the value for

221
00:14:20,870 --> 00:14:28,340
one of the keys and the key is farm when we call farm for this one we get a farm of five.

222
00:14:28,520 --> 00:14:33,090
But you know what we actually need to force unwrap this so that we pull out the value successfully.

223
00:14:33,110 --> 00:14:39,430
So for this example we have to slash farm five k.

224
00:14:39,500 --> 00:14:44,010
And after that we can do dot static flicker dot com.

225
00:14:44,360 --> 00:14:45,750
So let's type that at the end.

226
00:14:45,800 --> 00:14:49,870
Static flicker dot com slash.

227
00:14:50,150 --> 00:14:51,160
And now what.

228
00:14:51,350 --> 00:14:53,170
Six seven nine.

229
00:14:53,180 --> 00:14:57,550
Now I'm going to give you a clue that is actually the server number.

230
00:14:57,660 --> 00:14:59,840
OK I told you that before but that is what it is.

231
00:14:59,840 --> 00:15:02,690
So to get that we're going to use string concatenation again.

232
00:15:02,690 --> 00:15:04,640
I'm sorry string encapsulation.

233
00:15:04,640 --> 00:15:09,860
I always flip those terms and we're going to go to the photo dictionary and we're going to pull out

234
00:15:09,860 --> 00:15:14,380
the value for server force and wrap it as well.

235
00:15:14,650 --> 00:15:18,880
OK so now we have the value for the server number.

236
00:15:18,920 --> 00:15:22,550
So for this example the server number would be 4 to 1 1.

237
00:15:22,880 --> 00:15:23,220
Okay.

238
00:15:23,220 --> 00:15:26,230
Next up we're going to go ahead and pull out the photo ID.

239
00:15:26,240 --> 00:15:28,170
That's like the unique ID of the photo.

240
00:15:28,370 --> 00:15:34,700
So if you look at the you Arel this last part starts with the ID right here.

241
00:15:34,790 --> 00:15:35,260
OK.

242
00:15:35,820 --> 00:15:43,920
So we're going to go ahead and use string encapsulation again to pull out photo and call the ID parameter

243
00:15:44,730 --> 00:15:46,010
and force on rapid.

244
00:15:46,260 --> 00:15:50,690
Wonderful but you'll notice that right after the ID there's an underscore.

245
00:15:50,860 --> 00:15:57,780
OK so let's put that in R U R L and then after that we actually need the secret K and you can see the

246
00:15:57,780 --> 00:15:59,970
secret right there.

247
00:15:59,970 --> 00:16:04,950
So let's do what we've been doing string encapsulation photo whoopsies.

248
00:16:05,220 --> 00:16:06,070
Toe.

249
00:16:06,570 --> 00:16:11,450
And we're going to pull out secret and force and wrap it.

250
00:16:11,640 --> 00:16:11,870
All right.

251
00:16:11,880 --> 00:16:16,070
After that we're going to go ahead and do underscore K.

252
00:16:16,360 --> 00:16:21,440
Let's do that underscore K underscore d dot Jaypee.

253
00:16:21,950 --> 00:16:23,460
And you know what that is r u r l.

254
00:16:23,460 --> 00:16:27,590
That was really messy having to siphon through all of that Jason.

255
00:16:28,050 --> 00:16:35,100
But we now have a post u r l and we know exactly where we can append that image u r l array so let's

256
00:16:35,100 --> 00:16:35,880
do that.

257
00:16:35,880 --> 00:16:38,910
Go ahead and type self image u r LRA.

258
00:16:38,980 --> 00:16:45,000
Append new element post u r l and that is that.

259
00:16:45,000 --> 00:16:51,150
So once we have cycled through all of this image you are all image you are LRA will be nice and full.

260
00:16:51,360 --> 00:16:57,960
And at the end of that call we can use our handler to escape to notify us that we're done downloading

261
00:16:57,960 --> 00:16:59,150
all your else.

262
00:16:59,220 --> 00:17:10,100
So go ahead and type handler whip's handler and pass in a boolean of true so that is done make sure

263
00:17:10,100 --> 00:17:11,680
that you study this and go through it.

264
00:17:11,870 --> 00:17:15,360
If you already have experience with Jaison this might be quite easy for you.

265
00:17:15,710 --> 00:17:19,300
But if not it might take a while to understand what's really going on here.

266
00:17:19,370 --> 00:17:25,190
But let's go back up to where we call this function in dropped pin and I'm actually going to print out

267
00:17:25,220 --> 00:17:29,300
the image you are LRA so you can see all the imagery or else that we've just made.

268
00:17:29,360 --> 00:17:34,270
So go ahead and type print image you are LRA and let's build and run this app.

269
00:17:34,580 --> 00:17:41,000
Oh whoops of course we need to make a reference to self because we're inside of a closure here and retrieve

270
00:17:41,000 --> 00:17:48,230
you or else build and run and we're going to see if this worked if our your L's are being properly downloaded

271
00:17:48,230 --> 00:17:51,240
and pulled out from our Jason File.

272
00:17:51,260 --> 00:17:55,500
So go ahead and double click and look at that.

273
00:17:55,510 --> 00:17:56,680
That looks pretty good.

274
00:17:56,680 --> 00:18:04,780
Let's see farm five static flicker dot com slash for two on one there's the ID secret Cady to double

275
00:18:04,780 --> 00:18:05,610
check that this worked.

276
00:18:05,610 --> 00:18:12,520
I'm going to actually copy one of these into my browser and see if it worked.

277
00:18:12,540 --> 00:18:17,350
Kate says this photo is no longer available so that means we did something wrong.

278
00:18:17,520 --> 00:18:20,810
Let's see if we can figure out what the issue was.

279
00:18:20,880 --> 00:18:27,490
Or alternatively that image may actually just be deleted or not available.

280
00:18:27,780 --> 00:18:28,790
OK so that's not good.

281
00:18:28,790 --> 00:18:38,060
It's telling us that there is a problem farm five static flicker dot com slash server slash ID secret

282
00:18:38,070 --> 00:18:38,820
k d.

283
00:18:38,820 --> 00:18:46,980
So let's go back to that photo we had of our gorilla friend and let's see whoopsies Let's see what the

284
00:18:47,030 --> 00:18:52,570
your L was when we copied the link pasted it here.

285
00:18:52,590 --> 00:18:53,130
Let's take a look.

286
00:18:53,130 --> 00:18:54,200
What did we miss.

287
00:18:54,270 --> 00:19:03,820
Farm one static flicker dot com server ID secret k.d. lang.

288
00:19:04,190 --> 00:19:06,380
Hmm interesting.

289
00:19:06,520 --> 00:19:11,550
So we may have missed a slash here or there.

290
00:19:11,950 --> 00:19:14,170
Let's go ahead and let's head down.

291
00:19:14,170 --> 00:19:16,360
We have the farm number.

292
00:19:16,360 --> 00:19:19,340
We have static flicker dot com.

293
00:19:19,400 --> 00:19:20,260
Is that all right.

294
00:19:20,290 --> 00:19:25,740
Static flicker dot com slash the server number.

295
00:19:26,350 --> 00:19:26,940
OK.

296
00:19:27,010 --> 00:19:36,750
And we have Yeff the farm the server number we have the ID underscore the secret Cady.

297
00:19:37,200 --> 00:19:37,600
You know what.

298
00:19:37,620 --> 00:19:43,290
Let's see there are some other letters HD for instance downloads a medium sized image.

299
00:19:43,290 --> 00:19:46,710
So let's see if it's just an issue with using large images.

300
00:19:49,090 --> 00:19:50,380
And you know what it looks like.

301
00:19:50,380 --> 00:19:56,020
That was the problem because it just downloaded the image here for me in medium size so it looks like

302
00:19:56,020 --> 00:19:59,150
maybe large images are not accessible by the API.

303
00:19:59,230 --> 00:20:00,190
That's good to know.

304
00:20:00,340 --> 00:20:02,950
So let's go ahead and replace k with h.

305
00:20:02,950 --> 00:20:09,790
Let's build it one more time and you should be able to see a giant list of properly formatted you or

306
00:20:09,790 --> 00:20:13,180
else show up right here in our console.

307
00:20:13,180 --> 00:20:14,590
Let's do that.

308
00:20:14,590 --> 00:20:18,190
Here we go double click downloads all those you are else.

309
00:20:18,190 --> 00:20:18,860
Lovely.

310
00:20:18,940 --> 00:20:22,640
And let's go ahead and let's paste this into safari.

311
00:20:23,170 --> 00:20:25,300
And here we go.

312
00:20:27,120 --> 00:20:27,420
All right.

313
00:20:27,440 --> 00:20:29,310
It downloaded.

314
00:20:29,370 --> 00:20:30,690
And here we are.

315
00:20:30,770 --> 00:20:33,330
There's somebody at Disneyland.

316
00:20:33,330 --> 00:20:33,780
Awesome.

317
00:20:33,790 --> 00:20:36,120
So it is properly downloading the images.

318
00:20:36,120 --> 00:20:40,890
We have lots of you or else in the next video we're going to use these you are else to download those

319
00:20:40,890 --> 00:20:45,180
images and save them into our application using Alamo fire image.

320
00:20:45,180 --> 00:20:46,080
Amazing job.

321
00:20:46,080 --> 00:20:47,780
And let's head over to the next one.
